query if [ x"$PID" != x"" ]; then kill -TERM $PID echo "$AppName (pid:$PID) exiting..." while [ x"$PID" != x"" ] do sleep 1 query done echo "$AppName exited." else echo "$AppName already stopped." fi }
function restart() { stop sleep 2 start }
function status() { PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` if [ $PID != 0 ];then echo "$AppName is running..." else echo "$AppName is not running..." fi }
case $1 in start) start;; stop) stop;; restart) restart;; status) status;; *)
query if [ x"$PID" != x"" ]; then kill -TERM $PID echo "$AppName (pid:$PID) exiting..." while [ x"$PID" != x"" ] do sleep 1 query done echo "$AppName exited." else echo "$AppName already stopped." fi }
function restart() { stop sleep 2 start }
function status() { PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` if [ $PID != 0 ];then echo "$AppName is running..." else echo "$AppName is not running..." fi }
case $1 in start) start;; stop) stop;; restart) restart;; status) status;; *)
esac
1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/bash
cd /opt/data/backed/backed/fronted npm install --registry=https://registry.npmmirror.com npm run build:prod cd /www/wwwroot/huanding.com rm -rf /www/wwwroot/huanding.com/*