Initial commit of source code and docs

This commit is contained in:
2019-03-03 22:22:56 +01:00
commit e41f8bba2a
15 changed files with 1888 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
#!/sbin/openrc-run
user=${USER:-daemon:nobody}
socket="${SOCKET:-}"
milter_opts="${MILTER_OPTS:-}"
pidfile="/run/${RC_SVCNAME}.pid"
command="/usr/bin/pyquarantine-milter"
command_args="-s ${socket} ${milter_opts}"
command_background=true
start_stop_daemon_args="--user ${user}"
extra_commands="configtest"
depend() {
need net
before mta
}
checkconfig() {
if [ -z "${socket}" ]; then
eerror "No socket specified in config!"
fi
OUTPUT=$( ${command} ${command_args} -t 2>&1 )
ret=$?
if [ $ret -ne 0 ]; then
eerror "${SVCNAME} has detected an error in your configuration:"
printf "%s\n" "${OUTPUT}"
fi
return $ret
}
configtest() {
ebegin "Checking ${SVCNAME} configuration"
checkconfig
eend $?
}
start_pre() {
if [ "${RC_CMD}" != "restart" ]; then
checkconfig || return $?
fi
}
stop_pre() {
if [ "${RC_CMD}" != "restart" ]; then
checkconfig || return $?
fi
}