This commit is contained in:
Mr Chen
2018-12-12 19:30:42 +08:00
parent 6ad1292003
commit 6259f21196
4 changed files with 22 additions and 15 deletions
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
mw_start(){
gunicorn -c setting.py app:app &
python task.py &
}
mw_stop()
{
ps -ef|grep app:app |grep -v grep|awk '{print $2}'|xargs kill -9
ps -ef|grep task.py |grep -v grep|awk '{print $2}'|xargs kill -9
}
case "$1" in
'start') mw_start;;
'stop') mw_stop;;
'restart') mw_stop mw_start;;
esac