do mysql connection check for all scripts, found out hard way vmail-purge-dirs.sh wipes out all email data if it can not connect to mysql

This commit is contained in:
Matthew Saunders Brown 2025-02-27 15:46:37 -08:00
parent fff2b4728f
commit 3083dc6e29

View File

@ -30,9 +30,6 @@ else
fi fi
fi fi
# Only Debian-exim commands do not require MySQL running, (almost) all others do:
if [[ "$USER" != "Debian-exim" ]]; then
# check that MYSQL_CONNECTION_INFO_FILE exists and is readable # check that MYSQL_CONNECTION_INFO_FILE exists and is readable
if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then
echo "ERROR: MySQL connection info file ($MYSQL_CONNECTION_INFO_FILE) does not exist or is not readable." echo "ERROR: MySQL connection info file ($MYSQL_CONNECTION_INFO_FILE) does not exist or is not readable."
@ -53,8 +50,6 @@ if [[ "$USER" != "Debian-exim" ]]; then
exit 1 exit 1
fi fi
fi
# functions # functions
# crude but good enough domain name format validation # crude but good enough domain name format validation