summaryrefslogtreecommitdiff
path: root/debian/mailgraph.postinst
diff options
context:
space:
mode:
authorJulien Valroff <julien@kirya.net>2010-08-29 18:30:34 +0200
committerJulien Valroff <julien@kirya.net>2010-08-29 18:30:34 +0200
commit999ee603379f337cb3282b05517648eda1dbf1b7 (patch)
tree1c2f38bd266a8644a845cc72e40253c70cf9b1d5 /debian/mailgraph.postinst
parent8c28fd20bba4c8aaef3ff3d8f14660bb8a78700a (diff)
Use ucf for conffile
Diffstat (limited to 'debian/mailgraph.postinst')
-rw-r--r--debian/mailgraph.postinst25
1 files changed, 16 insertions, 9 deletions
diff --git a/debian/mailgraph.postinst b/debian/mailgraph.postinst
index 4dea08d..3af0c30 100644
--- a/debian/mailgraph.postinst
+++ b/debian/mailgraph.postinst
@@ -32,15 +32,22 @@ case "$1" in
db_get mailgraph/ignore_localhost
IGNORE_LOCALHOST=$RET
- if [ -w $DF ]; then
- TEMPFILE=`mktemp` || exit 1
- sed $DF -e "s,^ *BOOT_START=.*,BOOT_START=$BOOT_START," \
- -e "s,^ *MAIL_LOG=.*,MAIL_LOG=$MAIL_LOG," \
- -e "s,^ *IGNORE_LOCALHOST=.*,IGNORE_LOCALHOST=$IGNORE_LOCALHOST," \
- > $TEMPFILE
- mv -f $TEMPFILE $DF
- chmod 644 $DF
- fi
+ db_stop
+
+ TEMPFILE=`mktemp`
+ cat << _eof > $TEMPFILE
+ # Should Mailgraph start on boot
+ BOOT_START=$BOOT_START
+
+ # Logfile used by mailgraph
+ MAIL_LOG=$MAIL_LOG
+
+ # Ignore mail to/from localhost
+ IGNORE_LOCALHOST=$IGNORE_LOCALHOST
+ _eof
+
+ ucf $TEMPFILE /etc/default/mailgraph
+ rm -f $TEMPFILE
;;