Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/cli.sh

41 lines
680 B

8 years ago
#!/bin/bash
7 years ago
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/lib/python2.7/bin
8 years ago
mw_start(){
7 years ago
gunicorn -c setting.py app:app
8 years ago
python task.py &
}
8 years ago
mw_start_debug(){
7 years ago
8 years ago
python task.py &
7 years ago
gunicorn -b :7200 -k gevent -w 1 app:app
# gunicorn -b :7200 -k eventlet -w 1 app:app
8 years ago
# gunicorn -c setting.py app:app
8 years ago
}
8 years ago
mw_stop()
{
7 years ago
PLIST=`ps -ef|grep app:app |grep -v grep|awk '{print $2}'`
for i in $PLIST
do
kill -9 $i
done
8 years ago
ps -ef|grep task.py |grep -v grep|awk '{print $2}'|xargs kill -9
}
case "$1" in
'start') mw_start;;
'stop') mw_stop;;
8 years ago
'restart')
mw_stop
mw_start
;;
8 years ago
'debug')
mw_stop
mw_start_debug
;;
8 years ago
esac