From 476356dda7b96b95ffa9d3a98c29bee57be6151e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 12 Dec 2018 19:30:42 +0800 Subject: [PATCH] update --- cli.sh | 22 ++++++++++++++++++++++ restart.sh | 4 ---- start.sh | 4 ---- stop.sh | 7 ------- 4 files changed, 22 insertions(+), 15 deletions(-) create mode 100755 cli.sh delete mode 100755 restart.sh delete mode 100755 start.sh delete mode 100755 stop.sh 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