Skip to content

Instantly share code, notes, and snippets.

@freshyill
Forked from mheadd/monitor.sh
Last active August 29, 2015 13:58
Show Gist options
  • Save freshyill/10280183 to your computer and use it in GitHub Desktop.
Save freshyill/10280183 to your computer and use it in GitHub Desktop.
#!/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