Created
May 16, 2016 20:01
-
-
Save dotob/5164785c9e1ba218d2b1de1c9c9bb60c to your computer and use it in GitHub Desktop.
small script to check if mysql is running and restart it if not
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
echo "check mysql" | |
service mysql status | grep -qE [0-9]{5} | |
if [ $? -eq 0 ]; then | |
echo OK | |
else | |
service mysql start | |
echo "-" | mail -s "fringshaus.de mysql restarted" -r [email protected] [email protected] | |
echo "mysql restarted, mail sent" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment