Restarting the apache2 service by using the bash scripting - Tecnew

Home Ads

Restarting the apache2 service by using the bash scripting

Restarting the apache2 service by using the bash scripting

Share This

Below Bash script will restart the apache2 service 


#!/bin/bash

RESTART="sudo service apache2 restart"

PGREP="/usr/bin/pgrep"

APACHE2="apache2"

$PGREP ${APACHE2}

if [ $? -ne 0 ]

then

$RESTART

fi


No comments:

Post a Comment