From 0672a9a0be1ff5351b9ed64104c737488c093def Mon Sep 17 00:00:00 2001 From: Julien Valroff Date: Sat, 4 Sep 2010 14:15:48 +0200 Subject: Fixes for previous commit --- debian/mailgraph.default | 6 +++--- debian/mailgraph.postinst | 16 ++++++---------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/debian/mailgraph.default b/debian/mailgraph.default index 12f380a..f302084 100644 --- a/debian/mailgraph.default +++ b/debian/mailgraph.default @@ -4,14 +4,14 @@ # # Should Mailgraph start on boot (true|false) (default: true) -BOOT_START=$BOOT_START +BOOT_START=true # Logfile used by mailgraph (default: /var/log/mail.log) -MAIL_LOG=$MAIL_LOG +MAIL_LOG=/var/log/mail.log # Ignore mails from localhost (true|false) (default: false) # When true, this will pass --ignore-localhost to mailgraph daemon -IGNORE_LOCALHOST=$IGNORE_LOCALHOST +IGNORE_LOCALHOST=false # Extra options to be passed to mailgraph daemon # See mailgraph -h output (default: "") diff --git a/debian/mailgraph.postinst b/debian/mailgraph.postinst index 2464098..2bfa4db 100644 --- a/debian/mailgraph.postinst +++ b/debian/mailgraph.postinst @@ -21,22 +21,18 @@ set -e case "$1" in configure) - db_get mailgraph/start_on_boot || true - BOOT_START=$RET - - db_get mailgraph/mail_log || true - MAIL_LOG=$RET - - db_get mailgraph/ignore_localhost - IGNORE_LOCALHOST=$RET - TEMPFILE=`tempfile` cp -p /usr/share/mailgraph/mailgraph.default ${TEMPFILE} + # Merge debconf values into the configuration + for i in BOOT_START=start_on_boot MAIL_LOG=mail_log IGNORE_LOCALHOST=ignore_localhost; do + db_get rkhunter/${i%=*} + sed -i -re "s@^(${i#*=}=).*@\1\"${RET}\"@" "$TEMPFILE" + done + ucf --three-way --debconf-ok ${TEMPFILE} /etc/default/mailgraph ucfr mailgraph /etc/default/mailgraph rm -f ${TEMPFILE} - ;; abort-upgrade|abort-remove|abort-deconfigure) -- cgit v1.2.3