2015-04-08 17:28:18 -06:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
2017-01-23 09:35:38 -07:00
|
|
|
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
|
|
|
|
2015-04-12 11:11:15 -06:00
|
|
|
|
2017-01-23 09:35:38 -07:00
|
|
|
cat=$(basename $package .zip)
|
2015-06-03 18:06:11 -06:00
|
|
|
outdir=$(dirname $(dirname $0))/packages/$cat
|
2015-04-08 17:28:18 -06:00
|
|
|
|
2017-01-23 09:35:38 -07:00
|
|
|
echo "Extracting to $outdir..."
|
2015-04-12 11:11:15 -06:00
|
|
|
mkdir -p $outdir
|
2017-01-23 09:35:38 -07:00
|
|
|
unzip -o -d $outdir $package
|
2015-04-12 11:11:15 -06:00
|
|
|
|
2017-01-23 09:35:38 -07:00
|
|
|
echo "Fixing permissions..."
|
|
|
|
chmod a+rx $outdir/*/ $outdir/*/*
|
|
|
|
chmod -R a+r $outdir
|
2017-06-17 00:29:20 -06:00
|
|
|
find $outdir/content -name \*.cgi -exec chmod a+rx {} \;
|
2015-04-12 11:11:15 -06:00
|
|
|
|
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
|