#!/bin/sh
#
# Start or stop rblmilter
#
# PROVIDE: rblmilter
# REQUIRE: DAEMON
# BEFORE: mail
# KEYWORD: shutdown
#
#
# Define these rblmilter_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/rblmilter
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#

. /etc/rc.subr

name="rblmilter"
desc="RBL Milter Daemon"
rcvar="rblmilter_enable"

load_rc_config $name

: ${rblmilter_enable:="NO"}
: ${rblmilter_socket:="/var/run/rbl-milter"}
: ${rblmilter_flags:="-l -r -d relays.ordb.org"}
command="%%PREFIX%%/sbin/rbl-milter"
start_precmd="rblmilter_prestart"
stop_postcmd="rblmilter_poststop"
extra_commands="reload"
command_args="-p local:${rblmilter_socket} ${rblmilter_flags}"

rblmilter_prestart()
{
	/bin/rm -f "${rblmilter_socket}"
}

rblmilter_poststop()
{
	/bin/rm -f "${rblmilter_socket}"
}

run_rc_command "$1"
