forked from haobin12358/hospital
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
33 lines (32 loc) · 783 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
P=6002
worker=4
host="0.0.0.0"
case "$@" in
start)
gunicorn -k gevent -b $host:$P -w $worker flaskrun:app -D
;;
stop)
kill -9 `ps aux|grep gunicorn|grep $P|awk '{print $2}'|xargs`
;;
restart)
kill -9 `ps aux|grep gunicorn|grep $P|awk '{print $2}'|xargs`
sleep 1
gunicorn -k gevent -b $host:$P -w $worker flaskrun:app -D
;;
reload)
ps aux |grep gunicorn |grep $P | awk '{print $2}'|xargs kill -HUP
;;
status)
pids=$(ps aux|grep gunicorn|grep $P)
echo "$pids"
;;
status2)
pids=$(ps aux|grep gunicorn|grep $SP)
echo "$pids"
;;
*)
echo 'unknown arguments args(start|stop|restart|status|reload)'
exit 1
;;
esac