X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=845fe4b5d263f7a1d30aff69f4c0409fe55bf3b7;hb=398d1393b4cd16ac3f5c5dd70295bbdbca78c18d;hp=83bd72f3f9e9821fb5c4cc9227d3b940823b3fe4;hpb=17963bc962935b6b4f9ecce21a36dfe2506a7afc;p=spamassassin-cn.git diff --git a/debian/postinst b/debian/postinst index 83bd72f..845fe4b 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,37 +1,16 @@ #!/bin/sh -# postinst script for spamassassin-cn -# -# see: dh_installdeb(1) set -e -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package -# - -case "$1" in - configure|reconfigure) - # continue below - ;; - - *) - exit 0 - ;; -esac - -# import CN-functions +[ "$1" = "configure" ] || exit 0 +[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx + +# Load CARNet Tools . /usr/share/carnet-tools/functions.sh -# load Debconf +# Load Debconf . /usr/share/debconf/confmodule + db_version 2.0 umask 022 @@ -59,7 +38,7 @@ db_stop || true if [ "$run_as_user" = "non-root" ]; then if ! grep -q '^OPTIONS=".*username=spamd"' \ /etc/default/spamassassin; then - systemctl stop spamassassin + service spamassassin stop rstart=yes fi @@ -87,7 +66,7 @@ if [ "$run_as_user" = "non-root" ]; then elif [ "$run_as_user" = "root" ]; then if grep -q '^OPTIONS=".*username=spamd"' \ /etc/default/spamassassin; then - systemctl stop spamassassin + service spamassassin stop restart=yes fi @@ -378,6 +357,10 @@ fi sa-update --import /etc/spamassassin/sa-keys.pgp \ >>/var/log/sa-update.log 2>&1 || true +# import http://spamassassin.apache.org/updates/GPG.KEY +echo "CN: Importing new http://spamassassin.apache.org/updates/GPG.KEY..." +sa-update --import /usr/share/spamassassin-cn/GPG.KEY + # clean old RulesDuJour rules echo "CN: Cleaning old RulesDuJour and SARE rules..." rm -rf /etc/spamassassin/*_sare_*.cf /etc/spamassassin/RulesDuJour @@ -400,12 +383,12 @@ echo "CN: SpamAssassin updates are now logged at /var/log/sa-update.log" # restart the spamasassin if [ "x$restart" = "xyes" ]; then pkill -f /usr/sbin/spamd || true - systemctl restart spamassassin + service spamassassin restart fi # restart the amavis if [ "x$restart" = "xyes" -a -x /etc/init.d/amavis ]; then - systemctl restart amavis + service amavis restart fi # dh_installdeb will replace this with shell code automatically