install_postfixadmin.sh: some changes in determinatiom MySQL installed Version.

This commit is contained in:
Christoph 2024-08-02 18:16:36 +02:00
parent a792c623bd
commit 3785baa94a

View File

@ -147,7 +147,7 @@ detect_mysql_version () {
MYSQL_CUR_DISTRIBUTION=
echo ""
echo " Select the MySQL distribution to install."
echo " Select the installed MySQL distribution."
echo ""
echo " [1] MySQL (the original community edition)"
echo " [2] Percona Server for MySQL"
@ -398,10 +398,12 @@ fi
if [[ "$POSTFIX_DB_TYPE" = "mysql" ]] ; then
if [[ -z ${MYSQL_CREDENTIALS} ]] ; then
detect_mysql_version
if [[ "$MYSQL_CUR_DISTRIBUTION" = "MariaDB" ]] && ([[ $MAJOR_VERSION -gt 10 ]] \
|| ( [[ $MAJOR_VERSION -eq 10 ]] && [[ $MINOR_VERSION -gt 3 ]] )) ; then
if [[ "$MYSQL_CUR_DISTRIBUTION" = "MariaDB" ]] && ([[ $MYSQL_MAJOR_VERSION -gt 10 ]] \
|| ( [[ $MYSQL_MAJOR_VERSION -eq 10 ]] && [[ $MYSQL_MINOR_VERSION -gt 3 ]] )) ; then
if [[ -S "/tmp/mysql.sock" ]]; then
MYSQL_CREDENTIALS="-u root -S /tmp/mysql.sock"
elif [[ -S "/run/mysqld/mysqld.sock" ]]; then
@ -417,7 +419,7 @@ if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then
else
echononl " Get MySQL command.."
echononl "\tGet MySQL command.."
mysql_command="$(which mysql)"
if [[ $? -eq 0 ]]; then
echo_ok
@ -451,6 +453,8 @@ if [[ "$POSTFIX_DB_TYPE" = "mysql" ]]; then
#else
# [[ -n "$MYSQL_CREDENTIALS" ]] || MYSQL_CREDENTIALS="$DEFAULT_MYSQL_CREDENTIALS"
#fi
fi
else
[[ "$POSTFIX_DB_TYPE" = "pgsql" ]] || fatal "Unknown Database Type '$POSTFIX_DB_TYPE' (POSTFIX_DB_TYPE)"
fi