diff options
Diffstat (limited to 'mail/py-spf-engine/files/pyspf-milter.in')
-rw-r--r-- | mail/py-spf-engine/files/pyspf-milter.in | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mail/py-spf-engine/files/pyspf-milter.in b/mail/py-spf-engine/files/pyspf-milter.in new file mode 100644 index 000000000000..a46dff0a7068 --- /dev/null +++ b/mail/py-spf-engine/files/pyspf-milter.in @@ -0,0 +1,42 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: pyspf_milter +# REQUIRE: LOGIN +# BEFORE: mail +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable pyspf_milter: +# +# pyspf_milter_enable (bool) Set to 'YES' to enable. +# Default: NO +# pyspf_milter_conffile (path) Location of configuration file. +# Default: %%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf + +. /etc/rc.subr + +name=pyspf_milter +rcvar=pyspf_milter_enable + +load_rc_config $name + +: ${pyspf_milter_enable:=NO} +: ${pyspf_milter_conffile:=%%PREFIX%%/etc/python-policyd-spf/policyd-spf.conf} + +command=/usr/sbin/daemon +command_interpreter=%%PYTHON_CMD%% +procname=%%PREFIX%%/bin/pyspf-milter +command_args="-c -f ${procname} ${pyspf_milter_conffile}" +pidfile=%%PYSPF_MILTER_RUNDIR%%/pyspf-milter.pid +required_dirs=%%PYSPF_MILTER_RUNDIR%% +required_files=${pyspf_milter_conffile} +start_precmd=pyspf_milter_cleanup +stop_postcmd=pyspf_milter_cleanup + +pyspf_milter_cleanup () +{ + rm -f ${pidfile} +} + +run_rc_command "$1" |