Created
May 4, 2017 03:14
-
-
Save erickvasilev/0ef277c9781ed37a446ce8f35742afec to your computer and use it in GitHub Desktop.
Bash Script - Restart MariaDB if Down
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 | |
/usr/sbin/service mysql status | grep "stopped\|dead" | |
if [ $? -eq 0 ]; then | |
printf 'mysql is not running....' | |
sudo service mysql start | |
else | |
printf 'mysql is running' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment