Created
July 18, 2012 21:40
-
-
Save alexlovelltroy/3139093 to your computer and use it in GitHub Desktop.
Django fcgi runner script
This file contains 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 | |
function start { | |
./manage.py runfcgi host=127.0.0.1 port=8080 | |
} | |
function stop { | |
PIDS=`ps aux |grep manage.py | grep -v grep|awk '{print $2}'` | |
kill $PIDS | |
} | |
function usage { | |
echo "usage: $0 [start|stop|restart|status]" | |
} | |
function status { | |
PIDS=`ps aux |grep manage.py | grep -v grep|awk '{print $2}'` | |
WORKERS=`echo $PIDS | wc -w` | |
echo "$WORKERS workers" | |
echo "$PIDS" | |
} | |
case "$1" in | |
"start") start; status;; | |
"stop") stop; status;; | |
"restart") stop; start; status;; | |
"status") status;; | |
*) usage;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment