last commit was a mistake, reverting code

This commit is contained in:
Matthew Saunders Brown 2025-02-28 15:41:04 -08:00
parent 3083dc6e29
commit f87b7a6f50

View File

@ -30,24 +30,29 @@ else
fi fi
fi fi
# check that MYSQL_CONNECTION_INFO_FILE exists and is readable # Only Debian-exim commands do not require MySQL running, (almost) all others do:
if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then if [[ "$USER" != "Debian-exim" ]]; then
echo "ERROR: MySQL connection info file ($MYSQL_CONNECTION_INFO_FILE) does not exist or is not readable."
exit 1
fi
# check that MySQL is running # check that MYSQL_CONNECTION_INFO_FILE exists and is readable
if ! systemctl --quiet is-active mariadb.service if [ ! -f "$MYSQL_CONNECTION_INFO_FILE" ]; then
then echo "ERROR: MySQL connection info file ($MYSQL_CONNECTION_INFO_FILE) does not exist or is not readable."
echo "MySQL (MariaDB) is not running." exit 1
exit 1 fi
fi
# check that MySQL is running
if ! systemctl --quiet is-active mariadb.service
then
echo "MySQL (MariaDB) is not running."
exit 1
fi
# check vmail MySQL connection/authentication
if ! mysql --defaults-extra-file=$MYSQL_CONNECTION_INFO_FILE -e '\q'
then
echo "MySQL connection failed. Check auth info in $MYSQL_CONNECTION_INFO_FILE"
exit 1
fi
# check vmail MySQL connection/authentication
if ! mysql --defaults-extra-file=$MYSQL_CONNECTION_INFO_FILE -e '\q'
then
echo "MySQL connection failed. Check auth info in $MYSQL_CONNECTION_INFO_FILE"
exit 1
fi fi
# functions # functions