Is it possible from within a bash script to check if a mysql database exists. Depending on the result then perform another action or terminate the script?
for db in $(mysql -u -p -N <<<"show databases like '%something%'")
do
case $db in
"something")
// do something
;;
"something else")
// do something else
;;
esac
done