From a4dedb185aa66f7036ce67877d69be296134cc83 Mon Sep 17 00:00:00 2001 From: Ivan Rako Date: Sun, 24 Feb 2008 18:52:29 +0000 Subject: [PATCH] r28: --- debian/postinst | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/debian/postinst b/debian/postinst index b1516e8..8fd8605 100755 --- a/debian/postinst +++ b/debian/postinst @@ -90,19 +90,17 @@ fi check_and_add_alias virusalert root check_and_add_alias spamalert root -if [ ! -f $AHOME/.spamassassin/user_prefs ] ; then - [ -d $AHOME/.spamassassin ] || mkdir -p $AHOME/.spamassassin - cat > $AHOME/.spamassassin/user_prefs <<-EEND +if [ -f $AHOME/.spamassassin/user_prefs ] ; then + user_prefs_temp=out=$(mktemp /tmp/user_prefs.XXXXXX) + cat > $user_prefs_temp <<-EEND bayes_path $AHOME/.spamassassin/bayes bayes_auto_expire 0 auto_whitelist_path $AHOME/.spamassassin/auto-whitelist EEND - chown_ahome=1 -fi - -if [ ! -f $AHOME/.spamassassin/auto-whitelist ] ; then - touch $AHOME/.spamassassin/auto-whitelist - chown_ahome=1 + if cmp -s $user_prefs_temp $AHOME/.spamassassin/user_prefs; then + rm -f $AHOME/.spamassassin/user_prefs + fi + rm -f $user_prefs_temp fi # No sysvinit order fixes -- 1.7.10.4