对页面的测试 curl
if [ "`curl -I -s -o /dev/null -w "%{http_code}\n" http://10.0.0.7"` = "200"] #if [`curl -I http://10.0.0.7 &>/dev/null|head -l|grep 200|wc -l` -eq 1] #-curl -s http://10.0.0.7 &> /dev/null #-if [ $? -eq 0 ] #if [ "`curl -s http://10.0.0.7 &> /dev/null&& echo $?`" = "0" ] #if [ "`curl -s http://10.0.0.7`" = "bbs" ] then echo "http is running" else echo "http is stopped" fi
if
条件
then
执行
elif
条件
then
执行
fi
浙公网安备 33010602011771号