mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-14 00:56:25 +02:00
Changed the message because it doesn't always download Fixes https://gitlab.alpinelinux.org/alpine/aports/-/issues/16630
39 lines
733 B
Bash
39 lines
733 B
Bash
#!/sbin/openrc-run
|
|
|
|
pidfile=${pidfile:-/run/spamd.pid}
|
|
command=/usr/sbin/spamd
|
|
command_args="${command_args:--m 5 -c -H}"
|
|
extra_started_commands="reload"
|
|
|
|
depend() {
|
|
need net
|
|
before mta
|
|
use logger
|
|
}
|
|
|
|
_legacy() {
|
|
[ -n "$PIDFILE" ] && pidfile=$PIDFILE
|
|
[ -n "$SPAMD_OPTS" ] && command_args=$SPAMD_OPTS
|
|
}
|
|
|
|
start_pre() {
|
|
_legacy
|
|
required_dirs="/var/lib/spamassassin/3.004001"
|
|
if [ ! -d $required_dirs ]; then
|
|
ebegin "Synchronising rules"
|
|
/usr/bin/sa-update && R=0 || R=$?
|
|
if [ $R -eq 1 ]; then
|
|
# "No fresh updates were available"; see sa-update(1)
|
|
R=0
|
|
fi
|
|
eend $R
|
|
fi
|
|
command_args="-d -r $pidfile $command_args"
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading $SVCNAME"
|
|
start-stop-daemon --signal=HUP --pidfile $pidfile
|
|
eend
|
|
}
|