Created
July 6, 2014 03:09
-
-
Save mapleray/0bdda9ca507de48d3d65 to your computer and use it in GitHub Desktop.
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 | |
if [ ! -n "$1" ] | |
then | |
echo "Usages: sh uwsgiserver.sh [start|stop|restart]" | |
exit 0 | |
fi | |
if [ $1 = start ] | |
then | |
psid=`ps aux | grep "uwsgi" | grep -v "grep" | wc -l` | |
if [ $psid -gt 4 ] | |
then | |
echo "uwsgi is running!" | |
exit 0 | |
else | |
uwsgi /etc/uwsgi.ini | |
echo "Start uwsgi service [OK]" | |
fi | |
elif [ $1 = stop ];then | |
killall -9 uwsgi | |
echo "Stop uwsgi service [OK]" | |
elif [ $1 = restart ];then | |
killall -9 uwsgi | |
/usr/bin/uwsgi --ini /etc/uwsgi.ini | |
echo "Restart uwsgi service [OK]" | |
else | |
echo "Usages: sh uwsgiserver.sh [start|stop|restart]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment