Mon 14 Mar 2011
Check to see if apache is running, if not start it
Posted by me under UncategorizedAdd Your Comments
[root@server~]# service httpd stop Stopping httpd: [ OK ] [root@server ~]# ./checkapache.sh httpd is NOT running. starting Starting httpd: [ OK ] [root@server ~]# ./checkapache.sh httpd is running [root@server~]# cat checkapache.sh #!/bin/bash if [ -z "$(pgrep httpd)" ] then echo "httpd is NOT running. starting" /sbin/service httpd start else echo "httpd is running" fi [root@server ~]#