-
-
Save realmau5/30cc9c2eee9a04b0ef538d5477c3890f to your computer and use it in GitHub Desktop.
Simple bash script to check whether MySQL is running.
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 | |
UP=$(pgrep mysql | wc -l); | |
if [ "$UP" -ne 1 ]; | |
then | |
echo "MySQL is down."; | |
sudo service mysql start | |
else | |
echo "All is well."; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment