diff --git a/ctl b/ctl index d517272..0f777e4 100755 --- a/ctl +++ b/ctl @@ -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 $?