Show error message if mysql client is not found

This commit is contained in:
Yavuz Aydın 2021-10-01 09:19:55 +02:00
parent 5e828b79db
commit 4c576d74e3
1 changed files with 16 additions and 0 deletions

View File

@ -29,6 +29,7 @@
# #
##############################################################################################
# #
# 2021/10/01 1.11 Show error message if mysql binaries are not found #
# 2021/07/27 1.10 Added PATH to include /usr/local/sbin and /usr/local/bin #
# 2021/07/26 1.9 Added MYSQL_BIN, MYSQLADMIN_BIN and MYSQLADMIN_BIN variables #
# 2020/12/30 1.8 Added DBS_SKIP to prevent dumping certain databases #
@ -104,6 +105,21 @@ MYSQL_BIN=$(which mysql)
MYSQLADMIN_BIN=$(which mysqladmin)
MYSQLDUMP_BIN=$(which mysqldump)
if [[ -z ${MYSQL_BIN} ]]; then
echo "Couldn't find mysql binary, exiting";
exit 1;
fi
if [[ -z ${MYSQLADMIN_BIN} ]]; then
echo "Couldn't find mysqladmin binary, exiting";
exit 1;
fi
if [[ -z ${MYSQLDUMP_BIN} ]]; then
echo "Couldn't find mysqldump binary, exiting";
exit 1;
fi
# Check if MYSQL_USER or MYSQL_PW is set and set options accordingly
MYSQL_OPTS=""