#! /bin/bash
expo_path=/usr/local/work/tomcat/tomcat2/bin
expo=`curl -I '{ print $2;exit}'`
date=$(date -d "today" +"%Y-%m-%d_%H:%M:%S")
if [ ${expo} == 200 ]
then
echo "访问正常无需发消息"
else
echo "==========tomcat is shutdown============"
${expo_path}/shutdown.sh
sleep 5
expo_pid=`ps -ef|grep tomcat2|grep -v grep|awk '{print $2}'` && kill -9 ${expo_pid}
echo "==========tomcat is start============"
${expo_path}/startup.sh
echo "ent.test.cn出现故障时间$date正在修复中"
fi
阅读(1266) | 评论(0) | 转发(0) |