Skip to content

Instantly share code, notes, and snippets.

@nwhobart
Created September 25, 2015 16:00
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 nwhobart/309d867d75d6667b35b2 to your computer and use it in GitHub Desktop.
Save nwhobart/309d867d75d6667b35b2 to your computer and use it in GitHub Desktop.
echo "Running a check on your DB creds"
mysql -u backup -p$mysqlpass -h $host -e "SHOW DATABASES;" &>/dev/null
rc=$?; if [[ $rc != 0 ]]; then echo "not working; check your creds" && exit $rc; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment