Created
June 12, 2013 12:22
-
-
Save radiosilence/5764790 to your computer and use it in GitHub Desktop.
A simple script to run via cron to make sure a process is running.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VENV=/home/greencall/webapps/greencall | |
do_check () { | |
if ps ux | grep -v grep | grep "$1" > /dev/null | |
then | |
exit | |
else | |
echo "Restarted with command $1" | |
$1 | |
fi | |
} | |
do_check "$VENV/bin/uwsgi --enable-threads --emperor $VENV/uwsgi.yaml --daemonize $VENV/uwsgi.log" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment