use quotes
This commit is contained in:
parent
25ce4c03e1
commit
f61a3926e6
1 changed files with 11 additions and 11 deletions
22
ctl
22
ctl
|
@ -19,14 +19,14 @@ else
|
||||||
mv "$BASE/config/release.json" "$BASE/data/release.json"
|
mv "$BASE/config/release.json" "$BASE/data/release.json"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -e $PID ]; then
|
if [ ! -e "$PID" ]; then
|
||||||
if [ -e "$DATA/tor/hostname" ]; then
|
if [ -e "$DATA/tor/hostname" ]; then
|
||||||
onion=$(cat "$DATA/tor/hostname")
|
onion=$(cat "$DATA/tor/hostname")
|
||||||
id=${onion/.onion/}
|
id=${onion/.onion/}
|
||||||
PID="/tmp/$NAME.$USER.$id.pid"
|
PID="/tmp/$NAME.$USER.$id.pid"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -e $PID ]; then
|
if [ ! -e "$PID" ]; then
|
||||||
PID="$DATA/$NAME.pid"
|
PID="$DATA/$NAME.pid"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -85,31 +85,31 @@ function remove_autostart {
|
||||||
if [ "$1" == "start" ]; then
|
if [ "$1" == "start" ]; then
|
||||||
remove_autostart
|
remove_autostart
|
||||||
cd "$BASE/$NAME"
|
cd "$BASE/$NAME"
|
||||||
if [ -e $PID ]; then
|
if [ -e "$PID" ]; then
|
||||||
if ps -p `cat "$PID"` > /dev/null; then
|
if ps -p `cat "$PID"` > /dev/null; then
|
||||||
echo openmedialibrary already running
|
echo openmedialibrary already running
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
python3 oml server $PID
|
python3 oml server "$PID"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "debug" ]; then
|
if [ "$1" == "debug" ]; then
|
||||||
cd "$BASE/$NAME"
|
cd "$BASE/$NAME"
|
||||||
if [ -e $PID ]; then
|
if [ -e "$PID" ]; then
|
||||||
if ps -p `cat "$PID"` > /dev/null; then
|
if ps -p `cat "$PID"` > /dev/null; then
|
||||||
echo openmedialibrary already running
|
echo openmedialibrary already running
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
python3 oml server debug $PID
|
python3 oml server debug "$PID"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "stop" ]; then
|
if [ "$1" == "stop" ]; then
|
||||||
remove_autostart
|
remove_autostart
|
||||||
if [ -e $PID ]; then
|
if [ -e "$PID" ]; then
|
||||||
_PID=`cat $PID`
|
_PID=`cat "$PID"`
|
||||||
kill $_PID
|
kill $_PID
|
||||||
waited=0
|
waited=0
|
||||||
while ps -p $_PID > /dev/null
|
while ps -p $_PID > /dev/null
|
||||||
|
@ -121,12 +121,12 @@ if [ "$1" == "stop" ]; then
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
test -e $PID && rm $PID
|
test -e "$PID" && rm "$PID"
|
||||||
fi
|
fi
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "restart" ]; then
|
if [ "$1" == "restart" ]; then
|
||||||
if [ -e $PID ]; then
|
if [ -e "$PID" ]; then
|
||||||
"$0" stop
|
"$0" stop
|
||||||
"$0" start
|
"$0" start
|
||||||
exit $?
|
exit $?
|
||||||
|
@ -140,7 +140,7 @@ if [ "$1" == "open" ]; then
|
||||||
open "/Applications/Open Media Library.app"
|
open "/Applications/Open Media Library.app"
|
||||||
fi
|
fi
|
||||||
if [ $SYSTEM == "Linux" ]; then
|
if [ $SYSTEM == "Linux" ]; then
|
||||||
if [ -e $PID ]; then
|
if [ -e "$PID" ]; 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
|
||||||
|
|
Loading…
Reference in a new issue