#!/bin/sh
#
# $Id$
#
# PROVIDE: rspamd_redirector
# REQUIRE: LOGIN
# KEYWORD: shutdown

#
# Add the following line to /etc/rc.conf to enable countd:
# rspamd-redirector (bool):          Set to "NO" by default.
#                          Set it to "YES" to enable redirector.

. /etc/rc.subr

name="rspamd_redirector"
rcvar=`set_rcvar`
procname="@CMAKE_INSTALL_PREFIX@/bin/rspamd-redirector"

load_rc_config $name

: ${rspamd_redirector_enable="NO"}
: ${rspamd_redirector_pidfile="/var/run/rspamd/redirector.pid"}

stop_postcmd="rm -f $rspamd_redirector_pidfile"

extra_commands="reload"
sig_reload="USR1"

command="$procname"
command_interpreter="/usr/bin/perl"

run_rc_command "$1"