novi kljuc i sa-update zbog problema opisanih na stranici: https://sysportal.carnet...
[spamassassin-cn.git] / debian / postinst
index 83bd72f..f11ad79 100755 (executable)
@@ -59,7 +59,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 +87,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
 
@@ -395,17 +395,25 @@ sa-update \
     --gpgkey 6C6191E3 \
     --gpgkey 24F434CE \
     --gpgkey BDE9DC10 >>/var/log/sa-update.log 2>&1 &
+
+# get rules https://sysportal.carnet.hr/node/1793
+echo "CN: Downloading new GPG key for SpamAssassin from http://spamassassin.apache.org/updates/GPG.KEY"
+echo "$(date +'%d-%m-%Y %T'): Downloading new GPG key from http://spamassassin.apache.org/updates/GPG.KEY ..." >> \
+    /var/log/sa-update.log
+wget -O - http://spamassassin.apache.org/updates/GPG.KEY 2> /dev/null | sa-update --import -
+sa-update -v
+restart=yes
 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