[fx] Update dbserver default following my.cnf value

In some case alternc/my.cnf can divege with values stored db_server.

my.cnf is authorative then we update db_server data in any case
This commit is contained in:
azerttyu 2017-10-08 14:45:54 +02:00
parent bd60767088
commit 53c516a59d
2 changed files with 16 additions and 0 deletions

View File

@ -572,6 +572,14 @@ if [ "$HAS_ROOT" != "1" ]; then
else
echo "Unable to create the first AlternC account (named 'admin'). newone.php returned $?. Check your MySQL database, PHP, and the /etc/alternc/local.sh file. Also check for any error above during install."
fi
else
##UPDATE default db_server following /etc/alternc/my.cnf values
if [ "$MYSQL_HOST" == "localhost" ]; then
MYSQL_HOST_CLIENT="localhost"
else
MYSQL_HOST_CLIENT="%"
fi
mysql --defaults-file=/etc/alternc/my.cnf -e "UPDATE db_servers SET host='$MYSQL_HOST', login='$MYSQL_USER', password='$MYSQL_PASS', client='$MYSQL_HOST_CLIENT' WHERE name='Default';"
fi
#giving vmail user read access on dovecot sql file

View File

@ -582,6 +582,14 @@ if [ "$HAS_ROOT" != "1" ]; then
else
echo "Unable to create the first AlternC account (named 'admin'). newone.php returned $?. Check your MySQL database, PHP, and the /etc/alternc/local.sh file. Also check for any error above during install."
fi
else
##UPDATE default db_server following /etc/alternc/my.cnf values
if [ "$MYSQL_HOST" == "localhost" ]; then
MYSQL_HOST_CLIENT="localhost"
else
MYSQL_HOST_CLIENT="%"
fi
mysql --defaults-file=/etc/alternc/my.cnf -e "UPDATE db_servers SET host='$MYSQL_HOST', login='$MYSQL_USER', password='$MYSQL_PASS', client='$MYSQL_HOST_CLIENT' WHERE name='Default';"
fi
# giving vmail user read access on dovecot sql file