#!/bin/sh
#
# $FreeBSD: ports/www/cherokee-devel/files/cherokee.sh.in,v 1.4 2007/04/26 19:40:00 sat Exp $
#
# PROVIDE: cherokee
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable cherokee:
#
# cherokee_enable (bool):	Set it to "YES" to enable cherokee
#				Default is "NO".
# cherokee_conf (path):		Set full path to config file.
#				Default is "/usr/local/etc/cherokee/cherokee.conf".
#

. /etc/rc.subr

name="cherokee"
rcvar=`set_rcvar`

load_rc_config $name

: ${cherokee_enable="NO"}
: ${cherokee_conf="/usr/local/etc/cherokee/cherokee.conf"}

command=/usr/local/sbin/cherokee
command_args="-C ${cherokee_conf} -b"
pidfile=/var/run/cherokee.pid
required_files=${cherokee_conf}
stop_postcmd=stop_postcmd

stop_postcmd()
{
	rm -f ${pidfile}
}

run_rc_command "$1"
