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

58 lines
897 B

7 years ago
#!/bin/bash
4 years ago
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
DIR=$(cd "$(dirname "$0")"; pwd)
MDIR=$(dirname "$DIR")
7 years ago
4 years ago
PATH=$PATH:$DIR/bin
4 years ago
if [ -f bin/activate ];then
source bin/activate
fi
7 years ago
4 years ago
export LC_ALL="en_US.UTF-8"
7 years ago
mw_start(){
6 years ago
gunicorn -c setting.py app:app
4 years ago
python3 task.py &
7 years ago
}
7 years ago
mw_start_debug(){
6 years ago
4 years ago
python3 task.py &
6 years ago
gunicorn -b :7200 -k gevent -w 1 app:app
# gunicorn -b :7200 -k eventlet -w 1 app:app
7 years ago
}
3 years ago
mw_start_debug2(){
gunicorn -c setting.py app:app
3 years ago
python3 task.py &
3 years ago
}
7 years ago
mw_stop()
{
6 years ago
PLIST=`ps -ef|grep app:app |grep -v grep|awk '{print $2}'`
for i in $PLIST
do
kill -9 $i
done
7 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;;
7 years ago
'restart')
mw_stop
mw_start
;;
7 years ago
'debug')
mw_stop
mw_start_debug
;;
3 years ago
'debug2')
mw_stop
mw_start_debug2
;;
7 years ago
esac