3
# amavisd-new cronjob helper
5
# Run it as root or as the amavis user
7
# First parameter specifies which cronjob routine to run:
8
# sa-sync: spamassassin fast sync
9
# sa-clean: spamassassin cleanup
11
test -e /usr/bin/sa-learn || exit 0
12
test -e /usr/sbin/amavisd-new || exit 0
20
# WATCH OUT FOR PROPER QUOTING LEVEL WHEN CALLING THIS!
22
if [ "$(id -u -n)" != "${SUUSER}" ]; then
23
exec /bin/su -s /bin/sh - "${SUUSER}" -c "$*"
25
# to get the same quoting level as the su path
32
do_amavis_cmd "/usr/bin/sa-learn --sync" '>/dev/null'
35
do_amavis_cmd "/usr/bin/sa-learn --sync --force-expire" '>/dev/null'
38
echo "$0: unknown cron routine $1" >&2