#! /bin/bash
id=`curl -I --connect-timeout 20 |awk '{ print $2;exit}'`
status=no
while [ true ]
do
sleep 10
if [ "${id}" != 200 ] && [ "$status" = ok ] ; then
echo '什么事都不做'
sleep 5
elif [ "${id}" != 200 ]; then
echo '发邮件通知'
echo '重启'
sleep 5
status=ok
elif [ "${id}" = 200 ] && [ "$status" = ok ]; then
echo '发邮件通知'
sleep 5
status=no
elif [ "${id}" = 200 ]; then
echo '正常'
fi
id=`curl -I --connect-timeout 20 |awk '{ print $2;exit}'`
阅读(1467) | 评论(1) | 转发(0) |