[root@db01-51 scripts]# cat check_web.sh #!/bin/bash if [ "`curl -I -s -w "%{http_code}\n" -o /dev/null www.baidu.com`" = "200" ] then echo "httpd is running" else echo "httpd is stopped" fi