检测tomcat运行状态,自动重启TOMCAT脚本SHELL
检测tomcat运行状态,自动重启TOMCAT脚本SHELL
检测tomcat运行状态,自动重启TOMCAT脚本SHELL
#!/bin/bash
jiankong()
{
netstat -ant|grep 8080
t=$?
if [[ $t -eq 0 ]] ;then
echo "8080 is ok"
fi
if [[ $t -eq 1 ]] ;then
echo "8080 is down"
service tomcat restart &
fi
}
while :
do
jiankong
sleep 3
done
评论暂时关闭