Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
paip
/
gitBuild
/
apps
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//paip/gitBuild/apps/script_lpr.sh
SERVICE_NAME=lpr_rest_api cd /paip/script/lpr/detectron2_LPR case $1 in start) PID=`ps -ef | grep $SERVICE_NAME | grep -v grep | awk ' {print $2}'` echo "Starting $SERVICE_NAME..." if [ "$PID" == "" ]; then nohup python3.9 -u lpr_rest_api.py > lpr.log & echo "$SERVICE_NAME is now started!" else echo "$SERVICE_NAME is already running... PID : $PID" fi ;; stop) PID=`ps -ef | grep $SERVICE_NAME | grep -v grep | awk ' {print $2}'` if [ "$PID" != "" ]; then echo "$SERVICE_NAME is stopping..." kill $PID; while [ 1 ] do pid2=`ps -ef | grep $SERVICE_NAME | grep -v grep | awk ' {print $2}'` if [ "$pid2" == "" ]; then echo "$SERVICE_NAME down!" exit else echo "$SERVICE_NAME is running... : $pid2" fi sleep 1 done else echo "$SERVICE_NAME down!" fi ;; restart) PID=`ps -ef | grep $SERVICE_NAME | grep -v grep | awk ' {print $2}'` if [ "$PID" != "" ]; then echo "$SERVICE_NAME is stopping..." kill $PID; while [ 1 ] do pid2=`ps -ef | grep $SERVICE_NAME | grep -v grep | awk ' {print $2}'` if [ "$pid2" == "" ]; then echo "$SERVICE_NAME down!" break else echo "$SERVICE_NAME is running... : $pid2" fi sleep 1 done sleep 1 echo "Starting $SERVICE_NAME ..." nohup python3.9 -u lpr_rest_api.py > lpr.log & echo "$SERVICE_NAME is now started!" else echo "$SERVICE_NAME down!" echo "Starting $SERVICE_NAME..." nohup python3.9 -u lpr_rest_api.py > lpr.log & echo "$SERVICE_NAME is now started!" fi ;; esac cd /paip/script