use variable for python executable
This commit is contained in:
parent
cd4ae21855
commit
73b8658c99
1 changed files with 11 additions and 9 deletions
20
ctl
20
ctl
|
@ -10,6 +10,8 @@ BASE=`pwd`
|
||||||
SYSTEM=`uname -s`
|
SYSTEM=`uname -s`
|
||||||
PLATFORM=`uname -m`
|
PLATFORM=`uname -m`
|
||||||
|
|
||||||
|
PYTHON=python3
|
||||||
|
|
||||||
DATA="$BASE/data"
|
DATA="$BASE/data"
|
||||||
if [ ! -e "$DATA" ] && [ -e "$BASE/config" ]; then
|
if [ ! -e "$DATA" ] && [ -e "$BASE/config" ]; then
|
||||||
if [ "$1" == "stop" ] || [ "$1" == "restart" ]; then
|
if [ "$1" == "stop" ] || [ "$1" == "restart" ]; then
|
||||||
|
@ -95,7 +97,7 @@ if [ "$1" == "start" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
python3 oml server "$PID"
|
$PYTHON oml server "$PID"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "debug" ]; then
|
if [ "$1" == "debug" ]; then
|
||||||
|
@ -107,7 +109,7 @@ if [ "$1" == "debug" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
python3 oml server debug "$PID"
|
$PYTHON oml server debug "$PID"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "stop" ]; then
|
if [ "$1" == "stop" ]; then
|
||||||
|
@ -147,11 +149,11 @@ if [ "$1" == "open" ]; then
|
||||||
if ps -p `cat "$PID"` > /dev/null; then
|
if ps -p `cat "$PID"` > /dev/null; then
|
||||||
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
|
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
|
||||||
else
|
else
|
||||||
python3 "${NAME}/oml/gtkstatus.py" $@
|
$PYTHON "${NAME}/oml/gtkstatus.py" $@
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
python3 "$NAME/oml/gtkstatus.py" $@
|
$PYTHON "$NAME/oml/gtkstatus.py" $@
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -163,7 +165,7 @@ if [ "$1" == "autostart" ]; then
|
||||||
fi
|
fi
|
||||||
if [ $SYSTEM == "Linux" ]; then
|
if [ $SYSTEM == "Linux" ]; then
|
||||||
if [ ! -e "$PID" ]; then
|
if [ ! -e "$PID" ]; then
|
||||||
python3 "$NAME/oml/gtkstatus.py" --autostart
|
$PYTHON "$NAME/oml/gtkstatus.py" --autostart
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -172,7 +174,7 @@ fi
|
||||||
|
|
||||||
if [ "$1" == "ui" ]; then
|
if [ "$1" == "ui" ]; then
|
||||||
shift
|
shift
|
||||||
python3 "$NAME/oml/ui.py" $@
|
$PYTHON "$NAME/oml/ui.py" $@
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "init" ]; then
|
if [ "$1" == "init" ]; then
|
||||||
|
@ -210,17 +212,17 @@ if [ "$1" == "update" ]; then
|
||||||
NEW=`"$0" version`
|
NEW=`"$0" version`
|
||||||
"$0" postupdate -o $OLD -n $NEW
|
"$0" postupdate -o $OLD -n $NEW
|
||||||
else
|
else
|
||||||
python3 oml update
|
$PYTHON oml update
|
||||||
fi
|
fi
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "python" ]; then
|
if [ "$1" == "python" ]; then
|
||||||
cd "$BASE/$NAME"
|
cd "$BASE/$NAME"
|
||||||
shift
|
shift
|
||||||
python3 $@
|
$PYTHON $@
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$BASE/$NAME"
|
cd "$BASE/$NAME"
|
||||||
python3 oml $@
|
$PYTHON oml $@
|
||||||
exit $?
|
exit $?
|
||||||
|
|
Loading…
Reference in a new issue