服务监听重启脚本

#!/bin/sh
. ~/.bash_profile


RES_9082=`curl http://127.0.0.1:9082/ifaceHN4O/services/operation?wsdl | wc -l`
RES_9083=`curl http://127.0.0.1:9083/ifaceHN4O/services/operation?wsdl | wc -l`

if [ ${RES_9082} -lt 10 ]; then
ps -ef | grep java | grep "/data/iface/tomcat " | awk '{print "kill -9 " $2}' | sh
/bin/sh /data/iface/tomcat/bin/startup.sh
fi

if [ ${RES_9083} -lt 10 ]; then
ps -ef | grep java | grep "/data/iface/tomcat-9083 " | awk '{print "kill -9 " $2}' | sh
/bin/sh /data/iface/tomcat-9083/bin/startup.sh
fi
posted @ 2022-08-10 17:26  一川烟草happy  阅读(44)  评论(0)    收藏  举报