Created
August 1, 2013 07:00
-
-
Save inlanger/6129030 to your computer and use it in GitHub Desktop.
Apache and MySQL process state monitor and reloader.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# APACHE SECTION | |
RESTART="/etc/init.d/apache2 restart" | |
PGREP="/usr/bin/pgrep" | |
HTTPD="apache" | |
$PGREP ${HTTPD} | |
if [ $? -ne 0 ] | |
then | |
$RESTART | |
fi | |
# MYSQL SECTION | |
RESTARTM="/etc/init.d/mysql restart" | |
MYSQLD="mysqld" | |
$PGREP ${MYSQLD} | |
if [ $? -ne 0 ] | |
then | |
$RESTARTM | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment