Skip to content

Instantly share code, notes, and snippets.

@JonnyFunFun
Created September 20, 2014 17:14
Show Gist options
  • Save JonnyFunFun/780afaac853b34d9a59a to your computer and use it in GitHub Desktop.
Save JonnyFunFun/780afaac853b34d9a59a 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.";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment