moth/bin/install-category

24 lines
444 B
Plaintext
Raw Normal View History

2015-04-08 17:28:18 -06:00
#! /bin/sh -e
package=$1
if ! [ -n "$package" -a -f $package ]; then
echo "Usage: $0 PACKAGE"
2015-04-08 17:28:18 -06:00
exit 1
fi
2015-06-03 17:59:58 -06:00
shift
2015-04-08 17:28:18 -06:00
cat=$(basename $package .zip)
outdir=$(dirname $(dirname $0))/packages/$cat
2015-04-08 17:28:18 -06:00
echo "Extracting to $outdir..."
mkdir -p $outdir
unzip -o -d $outdir $package
echo "Fixing permissions..."
chmod a+rx $outdir/*/ $outdir/*/*
chmod -R a+r $outdir
echo "Linking into web space..."
ln -sf ../packages/$cat/content $outdir/../../www/$cat