[fix] debian debconf settings for mysql : read from /etc/alternc/my.cnf

This commit is contained in:
alban 2014-09-29 16:36:52 +02:00
parent 4b0f852845
commit 1be8bc16d4
1 changed files with 7 additions and 4 deletions

11
debian/alternc.config vendored
View File

@ -105,6 +105,13 @@ QUEST_STATE=1
while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do
case "$QUEST_STATE" in
1)
if [ -r /etc/alternc/my.cnf ]; then
MYSQL_USER=$(cat /etc/alternc/my.cnf |grep "^user"|sed -r 's/user="(.*)"/\1/');
MYSQL_PASSWORD=$(cat /etc/alternc/my.cnf |grep "^password"|sed -r 's/password="(.*)"/\1/');
MYSQL_DATABASE=$(cat /etc/alternc/my.cnf |grep "^database"|sed -r 's/database="(.*)"/\1/');
MYSQL_HOST=$(cat /etc/alternc/my.cnf |grep "^host"|sed -r 's/host="(.*)"/\1/');
fi
if [ -r /etc/alternc/local.sh ]; then
# source the current config
. /etc/alternc/local.sh
@ -121,10 +128,6 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do
db_set alternc/alternc_logs "$ALTERNC_LOGS"
db_set alternc/monitor_ip "$MONITOR_IP"
db_set alternc/default_mx2 "$DEFAULT_SECONDARY_MX"
db_set alternc/mysql/host "$MYSQL_HOST"
db_set alternc/mysql/db "$MYSQL_DATABASE"
db_set alternc/mysql/user "$MYSQL_USER"
db_set alternc/mysql/password "$MYSQL_PASS"
db_set alternc/mysql/client "$MYSQL_CLIENT"
db_set alternc/sql/backup_type "$SQLBACKUP_TYPE"
db_set alternc/sql/backup_overwrite "$SQLBACKUP_OVERWRITE"