diff --git a/cli.sh b/cli.sh new file mode 100755 index 000000000..edaaf10f2 --- /dev/null +++ b/cli.sh @@ -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 \ No newline at end of file diff --git a/restart.sh b/restart.sh deleted file mode 100755 index 4bd80d67f..000000000 --- a/restart.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./stop.sh -./start.sh \ No newline at end of file diff --git a/start.sh b/start.sh deleted file mode 100755 index 47968b2f8..000000000 --- a/start.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -gunicorn -c setting.py app:app & -python task.py & \ No newline at end of file diff --git a/stop.sh b/stop.sh deleted file mode 100755 index 6d718e99b..000000000 --- a/stop.sh +++ /dev/null @@ -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" \ No newline at end of file