mirror of
https://github.com/capricornxl/ad-password-self-service.git
synced 2025-09-25 13:39:36 +08:00
默认的
django=2.2 version
This commit is contained in:
50
docker-src/uwsgiserver
Normal file
50
docker-src/uwsgiserver
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# Startup script for the uwsgi server
|
||||
# chkconfig: - 85 15
|
||||
# description: uwsgi server is Web Server
|
||||
# HTML files and CGI.
|
||||
# processname: uwsgiserver
|
||||
|
||||
INI="/opt/password-self-service/uwsgi.ini"
|
||||
UWSGI="/usr/local/bin/uwsgi"
|
||||
PSID=$(ps -ef | grep "password-self-service-uwsgi uWSGI master" | grep -v grep | awk '{print $2}')
|
||||
|
||||
if [ ! -n "$1" ]
|
||||
then
|
||||
content="Usages: $0 [start|stop|restart|status]"
|
||||
echo -e "\033[31m $content \033[0m"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $1 = start ]
|
||||
then
|
||||
if [[ `eval $PSID` -gt 4 ]]
|
||||
then
|
||||
content="uWsgi is Running!"
|
||||
echo -e "\033[32m $content \033[0m"
|
||||
exit 0
|
||||
else
|
||||
$UWSGI --ini $INI
|
||||
content="Start uWsgi Service [OK]"
|
||||
echo -e "\033[32m $content \033[0m"
|
||||
fi
|
||||
|
||||
elif [ $1 = stop ];then
|
||||
kill -9 $PSID > /dev/null 2>&1
|
||||
content="Stop uWsgi Service [OK]"
|
||||
echo -e "\033[32m $content \033[0m"
|
||||
|
||||
elif [ $1 = restart ];then
|
||||
kill -9 $PSID > /dev/null 2>&1
|
||||
echo "Pls wait...."
|
||||
sleep 3s
|
||||
$UWSGI --ini $INI
|
||||
content="Restart uWsgi Service [OK]"
|
||||
echo -e "\033[32m $content \033[0m"
|
||||
|
||||
elif [ $1 = status ];then
|
||||
ps -ef | grep "password-self-service-uwsgi" | grep -v "grep"
|
||||
else
|
||||
content="Usages: $0 [start|stop|restart|status]"
|
||||
echo -e "\033[31m $content \033[0m"
|
||||
fi
|
Reference in New Issue
Block a user