Posts

Showing posts from March 20, 2012

Restart apache if not running

#!/bin/bash RESTART="/sbin/service httpd restart" PGREP="/usr/bin/pgrep" HTTPD="httpd" $PGREP ${HTTPD} if [ $? -ne 0 ] # if apache not running then $RESTART fi