[root@db01-51 scripts]# cat check_web.sh #/bin/bash if [ "`curl -I www.baidu.com &>/dev/null && echo $?`" = "0" ] then echo "httpd is running" else echo "httpd is stoppd" fi