#!/bin/bash test -x /usr/bin/sa-update || exit 0 /usr/bin/sa-update code1=$? if [[ $code1 > 1 ]]; then echo "problem with sa-update" fi /usr/bin/sa-update --gpgkey D1C035168C1EBC08464946DA258CDB3ABDE9DC10 --channel saupdates.openprotect.com code2=$? if [[ $code2 > 1 ]]; then echo "problem with openprotect update" fi if [[ `expr $code1 + $code2` < 2 ]]; then /usr/bin/spamassassin --lint code3=$? if [[ $code3 = 0 ]]; then test -x /usr/sbin/amavisd-new || exit 0 /etc/init.d/amavis restart >/dev/null else echo "spamassassin failed to lint" fi fi