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

Comments

Popular posts from this blog

Black screen after logging in on Windows 2012 R2 using domain credentials on remote desktop connection

Water Wonder Resort

Client denied by server configuration error