This commit is contained in:
Mr Chen 2018-12-12 19:30:42 +08:00
parent 05c97b02b2
commit 476356dda7
4 changed files with 22 additions and 15 deletions

22
cli.sh Executable file
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

View File

@ -1,4 +0,0 @@
#!/bin/sh
./stop.sh
./start.sh

View File

@ -1,4 +0,0 @@
#!/bin/sh
gunicorn -c setting.py app:app &
python task.py &

View File

@ -1,7 +0,0 @@
#!/bin/sh
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
#open "http://127.0.0.1:7200"