Skip to content

Instantly share code, notes, and snippets.

@mikedamoiseau
Forked from mheadd/monitor.sh
Created June 5, 2014 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikedamoiseau/59a61da3dd2f446f3bc9 to your computer and use it in GitHub Desktop.
Save mikedamoiseau/59a61da3dd2f446f3bc9 to your computer and use it in GitHub Desktop.
#!/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