mirror of https://github.com/dirtbags/moth.git
27 lines
531 B
Bash
Executable File
27 lines
531 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
|
|
chmod a+rx $outdir/content/*/*.cgi
|
|
|
|
if [ ! -h $outdir/../../www/$cat ]; then
|
|
echo "Linking into web space..."
|
|
ln -sf ../packages/$cat/content $outdir/../../www/$cat
|
|
fi
|