- upgrade paketa za Debian Squeeze
[spamassassin-cn.git] / debian / postinst
index ff854eb..7f549cc 100755 (executable)
@@ -287,6 +287,16 @@ for i in $list; do
         mv -f $i.$$ $i
     fi
     rm -f $i.$$
+
+    # enable AWL
+    cp -f $i $i.$$
+    plugin="loadplugin Mail::SpamAssassin::Plugin::AWL"
+    cp_check_and_sed "^#$plugin.*$" \
+        "s/^#$plugin.*$/$plugin/g" $i.$$ || true
+    if ! cmp -s $i.$$ $i; then
+        mv -f $i.$$ $i
+    fi
+    rm -f $i.$$
 done
 
 # check and replace /etc/default/spamasassin if needed
@@ -396,7 +406,13 @@ if [ "x$restart" = "xyes" ]; then
 fi
 
 # restart the amavis
-if [ "x$restart" = "xyes" -a -x /etc/init.d/amavis ]; then
+if [ "x$restart" = "xyes" -a -x /etc/init.d/amavisd-cn ]; then
+    if [ -x /usr/sbin/invoke-rc.d ]; then
+        invoke-rc.d --quiet amavisd-cn restart 
+    else
+        /etc/init.d/amavisd-cn restart
+    fi
+elif [ "x$restart" = "xyes" -a -x /etc/init.d/amavis ]; then
     if [ -x /usr/sbin/invoke-rc.d ]; then
         invoke-rc.d --quiet amavis restart 
     else