#!/bin/sh
#
# $FreeBSD: ports/mail/mailman/files/mailman.in,v 1.2 2006/06/06 14:28:03 jmelo Exp $
#
# PROVIDE: mailman
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable mailman:
# mailman_enable (bool):        Set it to "YES" to enable mailman.
#                               Default is "NO".

. /etc/rc.subr

name="mailman"
rcvar=${name}_enable

pidfile="/usr/local/mailman/data/master-qrunner.pid"

load_rc_config $name

: ${mailman_enable="NO"}

start_cmd=${name}_start
stop_cmd=${name}_stop
extra_commands="reload"

mailman_start() {
	/usr/local/mailman/bin/mailmanctl -s -q start
}

mailman_stop() {
	/usr/local/mailman/bin/mailmanctl -q stop
}

run_rc_command "$1"
