restart.sh脚本模板
#!/bin/bash
cd /data/openapi
tmp2=`ps -ef |grep old |awk '{print $2}'|xargs kill -9`
sleep 10;
apimps=`ps gaux | grep old |grep -v grep |awk '{print $2}'`
if [ "$apim" == "" ] || [ $apim -ge 0 ];then
tmp2=`ps -ef | grep old |awk '{print $2}'|xargs kill -9`
sleep 10;
echo "---> Start the openapi."
nohup java -jar old -0.0.2-SNAPSHOT.jar > nohup.out 2>&1 &
else
echo "---> Start the openapi ."
nohup java -jar old -0.0.2-SNAPSHOT.jar > nohup.out 2>&1 &
fi

浙公网安备 33010602011771号