Files
server/etc/cron.daily/60sa-update
2026-01-08 18:34:49 +01:00

19 lines
450 B
Bash
Executable File

#!/bin/bash
### Copyright 1999-2025. WebPros International GmbH. All rights reserved.
sa_update()
{
/usr/bin/sa-update -D
local rc="$?"
case $rc in
# Only restart spamd if sa-update returns 0, meaning it updated the rules
0) env PATH=/opt/psa/admin/sbin:/usr/local/psa/admin/sbin:$PATH spammng --condrestart ;;
# If sa-update returns 1 then there are no updates
1) exit 0 ;;
esac
return $rc
}
sa_update >> /var/log/sa-update.log 2>&1