-
-
Save freshyill/10280183 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# | |
# Check if MySQL is running and start it if it's not | |
UP=$(pgrep mysql | wc -l); | |
if [ "$UP" -ne 1 ]; | |
then | |
echo "MySQL is down."; | |
mysql.server start | |
else | |
echo "MySQL is running."; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment