Skip to content

Instantly share code, notes, and snippets.

@erickvasilev
Created May 4, 2017 03:14
Show Gist options
  • Save erickvasilev/0ef277c9781ed37a446ce8f35742afec to your computer and use it in GitHub Desktop.
Save erickvasilev/0ef277c9781ed37a446ce8f35742afec to your computer and use it in GitHub Desktop.
Bash Script - Restart MariaDB if Down
#!/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