#!/bin/sh

# PROVIDE: ratbox-services
# REQUIRE: DAEMON
# BEFORE:  LOGIN

. %%RC_SUBR%%

name="ratbox_services"
rcvar=`set_rcvar`
load_rc_config $name

ratbox_services_enable=${ratbox_services_enable:-"NO"}
ratbox_services_user=${ratbox_services_user:-"ircservices"}
ratbox_services_group=${ratbox_services_group:-"ircservices"}

command="%%PREFIX%%/sbin/ratbox-services"
pidfile=%%RUNDIR%%/ratbox-services.pid
required_files="%%PREFIX%%/etc/ratbox-services.conf"

start_precmd=prestart
stop_precmd=prestop

prestart()
{
	touch $pidfile
	chown $ratbox_services_user:$ratbox_services_group $pidfile
}

prestop()
{
	rm -f $pidfile
}

run_rc_command "$1"


syntax highlighted by Code2HTML, v. 0.9.1