mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-23 19:25:25 +03:00
45 lines
773 B
Text
45 lines
773 B
Text
#!/sbin/openrc-run
|
|
supervisor=supervise-daemon
|
|
|
|
name=nullmailer
|
|
description="Nullmailer relay-only MTA"
|
|
|
|
command=/usr/sbin/nullmailer-send
|
|
|
|
depend() {
|
|
use net logger
|
|
}
|
|
|
|
checkconfig() {
|
|
local error=0
|
|
local f=/etc/nullmailer/me
|
|
if [ ! -s ${f} ]; then
|
|
eerror "${f} does not exist"
|
|
error=1
|
|
fi
|
|
f=/etc/nullmailer/defaultdomain
|
|
if [ ! -s ${f} ]; then
|
|
eerror "${f} does not exist"
|
|
error=1
|
|
fi
|
|
if [ ${error} -eq 1 ]; then
|
|
ewarn "Please correct the above missing nullmailer control files."
|
|
fi
|
|
if [ -e /service/nullmailer ]; then
|
|
eerror "Nullmailer is already running under svscan!"
|
|
error=2
|
|
fi
|
|
if [ ${error} -ne 0 ]; then
|
|
return 1
|
|
else
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
start_pre() {
|
|
checkconfig
|
|
}
|
|
|
|
stop_pre() {
|
|
checkconfig # to avoid init.d stopping svscan instance
|
|
}
|