Skip to content

Instantly share code, notes, and snippets.

@danielef
Created February 6, 2019 19:38
Show Gist options
  • Save danielef/8535cf662ba469c155a0c55d56bf24f6 to your computer and use it in GitHub Desktop.
Save danielef/8535cf662ba469c155a0c55d56bf24f6 to your computer and use it in GitHub Desktop.
basic start/stop script
#!/bin/bash
ACTION=$1
PID_FILE="/opt/py-orc/py-orc.pid"
case $ACTION in
start)
nohup /usr/bin/python3 /opt/py-orc/py-orc.py /opt/py-orc/apps.json > /opt/py-orc/nohup.out 2>&1 &
echo $! > $PID_FILE
;;
stop)
kill -9 $(cat $PID_FILE)
rm $PID_FILE
;;
*)
echo "INVALID OPTION"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment