Created
June 29, 2015 05:59
-
-
Save dwelch2344/6544e70abf08e6627237 to your computer and use it in GitHub Desktop.
Simple script to run in cron for resetting services
This file contains hidden or 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 | |
PATH=/usr/sbin:/usr/bin:/sbin:/bin | |
if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]] | |
then | |
/usr/sbin/service mysql start | |
sendemail -f [email protected] -t [email protected] -u subject -m "Restarted MySQL on ng-ocean" -s smtp.gmail.com -o tls=yes -xu [email protected] -xp "yourGmailPassword" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment