#!/bin/sh
#
# $NetBSD: radiusd.sh,v 1.6 2006/08/10 10:55:51 adrianp Exp $
#
# PROVIDE: radiusd
# REQUIRE: network
#

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

name="radiusd"
rcvar=${name}
command="/usr/pkg/sbin/radiusd"
pidfile="/var/run/radiusd/radiusd.pid"
start_precmd="radiusd_precmd"

radiusd_precmd()
{
	if [ ! -d /var/run/radiusd ]; then
		/bin/mkdir -p /var/run/radiusd
		/bin/chmod 0750 /var/run/radiusd
		/usr/sbin/chown radiusd:radiusd /var/run/radiusd
	fi
}

if [ -f /etc/rc.subr ]
then
	load_rc_config $name
	run_rc_command "$1"
else
	echo -n ' ${name}'
	exec ${command} ${radiusd_flags} ${command_args}
fi
