#!/bin/sh # Dinko Korunic exec 1>> /var/log/sa-update.log exec 2>&1 # announce echo "$(date +'%d-%m-%Y %T'): Fetching new SA rules..." # update SA if [ -e /etc/spamassassin/sa-update.channels ]; then sa-update \ --channelfile /etc/spamassassin/sa-update.channels \ --allowplugins \ --gpghomedir /etc/spamassassin/sa-update-keys || \ ( echo "$(date +'%d-%m-%Y %T'): No new rules. Exiting now."; exit ) fi # restart of services echo "$(date +'%d-%m-%Y %T'): Will restart services due to updated rules..." if [ -x /etc/init.d/spamassassin ]; then service spamassassin restart fi if [ -x /etc/init.d/amavis ]; then service amavis restart fi if [ -x /etc/init.d/postfix ]; then service postfix restart fi