1
0
Fork 0
mirror of https://github.com/dirtbags/moth.git synced 2025-01-05 11:30:41 -07:00
moth/bin/install-category

26 lines
553 B
Bash
Executable file

#! /bin/sh -e
package=$1
if ! [ -n "$package" -a -f $package ]; then
echo "Usage: $0 PACKAGE"
exit 1
fi
shift
cat=$(basename $package .zip)
outdir=$(dirname $(dirname $0))/packages/$cat
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
find $outdir/content -name \*.cgi -exec chmod a+rx {} \;
if [ ! -h $outdir/../../www/$cat ]; then
echo "Linking into web space..."
ln -sf ../packages/$cat/content $outdir/../../www/$cat
fi