- Update umask in cronjob (boo#861539) - Make sure that spamd can start (boo#961291) OBS-URL: https://build.opensuse.org/request/show/544097 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/spamassassin?expand=0&rev=102
44 lines
964 B
Bash
44 lines
964 B
Bash
#!/bin/bash
|
|
|
|
#
|
|
# paranoia settings
|
|
#
|
|
umask 022
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
export PATH
|
|
|
|
if [ -e /etc/sysconfig/spamd ]
|
|
then
|
|
. /etc/sysconfig/spamd
|
|
fi
|
|
|
|
if [ "$SPAM_SA_UPDATE" = "yes" ]
|
|
then
|
|
/usr/bin/sa-update &> /dev/null
|
|
result=$?
|
|
|
|
if [ "$SPAM_SA_COMPILE" = "yes" -a $result = 0 ] ; then
|
|
/usr/bin/sa-compile &> /dev/null
|
|
fi
|
|
|
|
if [ "$SPAM_SPAMD_RESTART" = "yes" -a $result = 0 ] ; then
|
|
/sbin/service spamd restart &> /dev/null
|
|
fi
|
|
|
|
if [ "$SPAM_AMAVISD_RESTART" = "yes" -a $result = 0 ] ; then
|
|
/sbin/service amavis restart &> /dev/null
|
|
fi
|
|
|
|
if [ $result = 2 ] ; then
|
|
echo "sa-update lint check failed" | \
|
|
logger -t suse.cron-sa-update
|
|
fi
|
|
|
|
if [ $result -ge 3 ] ; then
|
|
echo "sa-update failed, exitcode $result" | \
|
|
logger -t suse.cron-sa-update
|
|
fi
|
|
fi
|
|
exit 0
|