- #! /bin/bash
- chd='www.5dforum.com/bbs.php'
- mailer='lishiming2009@139.com'
- maxrp=3
- while :; do
- n1=0
- c=`ping -c 10 www.5dforum.com |grep received |awk '{print $4}' `
- if [ $c == "0" ] ; then
- for i in `seq 1 $maxrp`; do
- c=`ping -c 10 www.5dforum.com |grep received |awk '{print $4}' `
- if [ $c == "0" ] ; then
- n1=$i
- fi
- sleep 10
- done
- if [ $n1 == $maxrp ]; then
- echo "The 5dforum\'s network is down!"|mail -s 5dforum-down $mailer
- exit
- fi
- else
- if $(curl $chd|grep 'Discuz!'>/dev/null) ; then
- sleep 30
- else
- n2=0
- for i in `seq 1 $maxrp`; do
- if $(curl $chd|grep 'Discuz!'>/dev/null) ; then
- sleep 30
- else
- n2=$i
- fi
- done
- if [ $n2 == $maxrp ] ; then
- echo "The 5dforum is something wrong, please cheack!"|mail -s 5dforum-down $mailer
- exit
- fi
- fi
- fi
- sleep 30
- done
- 最新活动: 2016-01-26 10:36
- 浏览: 3873
- 关注: 9 人
编辑回复