#!/bin/sh

# Start or stop vbsfilter
#
# PROVIDE: vbsfilter
# REQUIRE: DAEMON
# BEFORE: mail
# KEYWORD: shutdown
#
#
# Define these vbsfilter_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/vbsfilter
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
# vbsfilter_flags Flags to vbsfilter

. /etc/rc.subr

name="vbsfilter"
desc="Vbs Attatchment Milter Daemon"
rcvar="vbsfilter_enable"

load_rc_config $name

: ${vbsfilter_enable:="NO"}
: ${vbsfilter_socket:="/var/run/vbsfilter"}
command="%%PREFIX%%/libexec/vbsfilter"
command_args="-p local:${vbsfilter_socket}"
procname="${command}"
start_precmd="vbsfilter_prestart"
stop_postcmd="vbsfilter_poststop"

vbsfilter_prestart()
{
	/bin/rm -f "${vbsfilter_socket}"
}

vbsfilter_poststop()
{
	/bin/rm -f "${vbsfilter_socket}"
}

run_rc_command "$1"
