Dental Articles - Edmonton
Bash Script Check is Apache is Down
Posted by negraru on Wed, 25 Apr 2018
Bash script to check if Apache server is up and running. If server is down, we will do a restart
#!/bin/bash
if curl -s --head 'https://your-domain.com/' | grep "200 OK" > /dev/null
then
echo "Apache server is up!" > /dev/null
else
echo "Apache server is down!"
/etc/init.d/apache2 restart
fi
Designer Edmonton