forked from 0x2620/pandora
wrap update in ctl
This commit is contained in:
parent
a1e6ad7b3d
commit
3dc8a0aba0
1 changed files with 11 additions and 1 deletions
12
ctl
12
ctl
|
@ -10,6 +10,7 @@ self=`readlink "$0"`
|
||||||
if [ -z $self ]; then
|
if [ -z $self ]; then
|
||||||
self="$0"
|
self="$0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$action" = "init" ]; then
|
if [ "$action" = "init" ]; then
|
||||||
cd "`dirname "$self"`"
|
cd "`dirname "$self"`"
|
||||||
BASE=`pwd`
|
BASE=`pwd`
|
||||||
|
@ -47,7 +48,15 @@ if [ "$action" = "init" ]; then
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$action" = "manage" ]; then
|
if [ "$action" = "manage" ]; then
|
||||||
|
cmd="pandora/manage.py"
|
||||||
|
fi
|
||||||
|
if [ "$action" = "update" ]; then
|
||||||
|
cmd="update.py"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -z $cmd ]; then
|
||||||
cd "`dirname "$self"`"
|
cd "`dirname "$self"`"
|
||||||
BASE=`pwd`
|
BASE=`pwd`
|
||||||
SUDO=""
|
SUDO=""
|
||||||
|
@ -56,9 +65,10 @@ if [ "$action" = "manage" ]; then
|
||||||
SUDO="sudo -H -u $PANDORA_USER"
|
SUDO="sudo -H -u $PANDORA_USER"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
$SUDO $BASE/pandora/manage.py $@
|
$SUDO "$BASE/$cmd" $@
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ `whoami` != 'root' ]; then
|
if [ `whoami` != 'root' ]; then
|
||||||
echo you have to be root or run $0 with sudo
|
echo you have to be root or run $0 with sudo
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue