[fix] don't override existing debconf values

This commit is contained in:
Pierre-Louis Bonicoli 2014-03-25 18:42:29 +01:00
parent a5f544b705
commit cfa27b2b56
1 changed files with 33 additions and 13 deletions

24
debian/alternc.config vendored
View File

@ -115,13 +115,19 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
fi fi
#We ask for the hosting name and the FQDN #We ask for the hosting name and the FQDN
db_get alternc/hostingname
if [ -z "$RET" ]; then
db_set alternc/hostingname "$HOSTING" db_set alternc/hostingname "$HOSTING"
db_set alternc/desktopname "$FQDN"
db_input high alternc/hostingname || true db_input high alternc/hostingname || true
fi
;; ;;
2) 2)
# Get the FQDN # Get the FQDN
db_get alternc/desktopname
if [ -z "$RET" ]; then
db_set alternc/desktopname "$FQDN"
db_input high alternc/desktopname || true db_input high alternc/desktopname || true
fi
# Be sure that the FQDN is lowercase (Bug #1405) # Be sure that the FQDN is lowercase (Bug #1405)
db_get alternc/desktopname db_get alternc/desktopname
db_set alternc/desktopname "`echo $RET | tr '[:upper:]' '[:lower:]'`" db_set alternc/desktopname "`echo $RET | tr '[:upper:]' '[:lower:]'`"
@ -129,7 +135,10 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
;; ;;
3) 3)
#we ask for the public and private ip #we ask for the public and private ip
db_get alternc/public_ip
if [ -z "$RET" ]; then
db_set alternc/public_ip "$PUBLIC_IP" db_set alternc/public_ip "$PUBLIC_IP"
fi
STATE=0 STATE=0
while [ $STATE -eq 0 ]; do while [ $STATE -eq 0 ]; do
db_input high alternc/public_ip || true db_input high alternc/public_ip || true
@ -157,8 +166,10 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
;; ;;
4) 4)
#private IP #private IP
db_get alternc/internal_ip
if [ -z "$RET" ]; then
db_set alternc/internal_ip "$INTERNAL_IP" db_set alternc/internal_ip "$INTERNAL_IP"
fi
STATE=0 STATE=0
while [ $STATE -eq 0 ]; do while [ $STATE -eq 0 ]; do
@ -173,16 +184,25 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
;; ;;
5) 5)
#We ask for the DNS server for the ip #We ask for the DNS server for the ip
db_get alternc/ns1
if [ -z "$RET" ]; then
db_set alternc/ns1 "$NS1_HOSTNAME" db_set alternc/ns1 "$NS1_HOSTNAME"
db_input high alternc/ns1 || true db_input high alternc/ns1 || true
fi
;; ;;
6) 6)
db_get alternc/ns2
if [ -z "$RET" ]; then
db_set alternc/ns2 "$NS2_HOSTNAME" db_set alternc/ns2 "$NS2_HOSTNAME"
db_input high alternc/ns2 || true db_input high alternc/ns2 || true
fi
;; ;;
7) 7)
db_get alternc/default_mx
if [ -z "$RET" ]; then
db_set alternc/default_mx "$DEFAULT_MX" db_set alternc/default_mx "$DEFAULT_MX"
db_input high alternc/default_mx || true db_input high alternc/default_mx || true
fi
;; ;;
8) 8)
if [ "`mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'SELECT "OK";' 2>/dev/null`" = "OK" ]; then if [ "`mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'SELECT "OK";' 2>/dev/null`" = "OK" ]; then