moth/bin/install-category

27 lines
531 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
2017-06-17 00:27:01 -06:00
chmod a+rx $outdir/content/*/*.cgi
2017-06-17 00:27:01 -06:00
if [ ! -h $outdir/../../www/$cat ]; then
echo "Linking into web space..."
ln -sf ../packages/$cat/content $outdir/../../www/$cat
fi