From 3dc8a0aba0f74685283be80f29e2c9f99fcf7ba6 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 31 May 2020 12:22:00 +0200 Subject: [PATCH] wrap update in ctl --- ctl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ctl b/ctl index b518cddd..28c74e12 100755 --- a/ctl +++ b/ctl @@ -10,6 +10,7 @@ self=`readlink "$0"` if [ -z $self ]; then self="$0" fi + if [ "$action" = "init" ]; then cd "`dirname "$self"`" BASE=`pwd` @@ -47,7 +48,15 @@ if [ "$action" = "init" ]; then fi exit 0 fi + if [ "$action" = "manage" ]; then + cmd="pandora/manage.py" +fi +if [ "$action" = "update" ]; then + cmd="update.py" +fi + +if [ ! -z $cmd ]; then cd "`dirname "$self"`" BASE=`pwd` SUDO="" @@ -56,9 +65,10 @@ if [ "$action" = "manage" ]; then SUDO="sudo -H -u $PANDORA_USER" fi shift - $SUDO $BASE/pandora/manage.py $@ + $SUDO "$BASE/$cmd" $@ exit $? fi + if [ `whoami` != 'root' ]; then echo you have to be root or run $0 with sudo exit 1