linux_java_启动一个项目脚本

 

test.sh

-------------------------------------------------------------------------------------------------------------

#!/bin/sh
while :
do
run1=$(ps -ef |grep 'sxnx-sms-8081' |grep -v "grep")
if [ "$run1" ] ; then
echo "The sxnx-sms-8081 service is alive!"
else
echo "The sxnx-sms service was shutdown!"
echo "Starting service sxnx-sms-8081..."
nohup java -jar $PWD/sxnx-sms-8081.jar&
echo "The service sxnx-sms-8081 was started!"
fi
sleep 10
done

posted @ 2020-06-03 20:23  Curedfisher  阅读(399)  评论(0编辑  收藏  举报