dont use exec

This commit is contained in:
j 2016-01-13 11:34:56 +05:30
parent ff58cd9295
commit e047ccf116
1 changed files with 15 additions and 8 deletions

23
ctl
View File

@ -80,7 +80,8 @@ if [ "$1" == "start" ]; then
exit 1
fi
fi
exec python3 oml server $PID
python3 oml server $PID
exit $?
fi
if [ "$1" == "debug" ]; then
cd "$BASE/$NAME"
@ -89,7 +90,8 @@ if [ "$1" == "debug" ]; then
exit 1
fi
shift
exec python3 oml server debug $PID
python3 oml server debug $PID
exit $?
fi
if [ "$1" == "stop" ]; then
remove_autostart
@ -101,7 +103,7 @@ if [ "$1" == "stop" ]; then
do
sleep 1
waited=$(($waited+1))
if [ $waited -gt 10 ]; then
if [ $waited -gt 11 ]; then
kill -9 $_PID
sleep 1
fi
@ -129,17 +131,20 @@ if [ "$1" == "open" ]; then
if ps -p `cat "$PID"` > /dev/null; then
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
else
exec python3 "$NAME/oml/gtkstatus.py" $@
python3 "$NAME/oml/gtkstatus.py" $@
exit $?
fi
else
exec python3 "$NAME/oml/gtkstatus.py" $@
python3 "$NAME/oml/gtkstatus.py" $@
exit $?
fi
fi
exit 0
fi
if [ "$1" == "ui" ]; then
shift
exec python3 "$NAME/oml/ui.py" $@
python3 "$NAME/oml/ui.py" $@
exit $?
fi
if [ "$1" == "update" ]; then
cd "$BASE/$NAME"
@ -163,8 +168,10 @@ fi
if [ "$1" == "python" ]; then
cd "$BASE/$NAME"
shift
exec python3 $@
python3 $@
exit $?
fi
cd "$BASE/$NAME"
exec python3 oml $@
python3 oml $@
exit $?