#!/bin/bash
while :
do
echo "Current DIR is " $PWD
stillRunning=$(ps -ef |grep "$PWD/oa.jar" |grep -v "grep")
if [ "$stillRunning" ] ; then
echo "TWS service was already started by another way"
echo "Kill it and then startup by this shell, other wise this shell will loop out this message annoyingly"
kill -9 $pidof $PWD/oa.jar
else
echo "TWS service was not started"
echo "Starting service ..."
$PWD/startup.sh
echo "TWS service was exited!"
fi
sleep 30
done
最后
以上就是重要麦片最近收集整理的关于java服务自动重启_Java web 应用自启动 shell脚本自动重启的全部内容,更多相关java服务自动重启_Java内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复