2002-05-10 20:59:23 +02:00
|
|
|
#!/bin/sh
|
2008-04-02 15:07:01 +02:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
2006-02-05 20:34:54 +01:00
|
|
|
# PROVIDE: radiusd
|
2007-03-28 18:22:40 +02:00
|
|
|
# REQUIRE: %%REQUIRE%%
|
2006-02-05 20:34:54 +01:00
|
|
|
# KEYWORD: shutdown
|
2004-08-29 04:18:42 +02:00
|
|
|
#
|
|
|
|
# Add the following lines to /etc/rc.conf to enable radiusd:
|
|
|
|
#
|
|
|
|
# radiusd_enable="YES"
|
|
|
|
#
|
2002-05-10 20:59:23 +02:00
|
|
|
|
2010-03-27 01:15:24 +01:00
|
|
|
. /etc/rc.subr
|
2002-05-10 20:59:23 +02:00
|
|
|
|
2004-08-29 04:18:42 +02:00
|
|
|
name=radiusd
|
2012-01-14 09:57:23 +01:00
|
|
|
rcvar=radiusd_enable
|
2007-12-06 11:01:02 +01:00
|
|
|
load_rc_config $name
|
2002-05-10 20:59:23 +02:00
|
|
|
|
2004-08-29 04:18:42 +02:00
|
|
|
command=%%PREFIX%%/sbin/radiusd
|
2008-07-28 15:14:17 +02:00
|
|
|
|
|
|
|
# In debug mode, radiusd doesn't create a pid file, so comment pidfile and
|
|
|
|
# let rc.subr use a process check on procname (which defaults to command).
|
|
|
|
#pidfile=/var/run/radiusd/radiusd.pid
|
|
|
|
|
|
|
|
extra_commands="reload debug"
|
|
|
|
debug_cmd="radiusd_debug"
|
|
|
|
|
2002-05-10 20:59:23 +02:00
|
|
|
|
2007-12-06 11:01:02 +01:00
|
|
|
# The radiusd_config parameter is now obsolete. Instead, derive the
|
|
|
|
# configuration directory name from radiusd_flags if possible, otherwise
|
|
|
|
# default to %%PREFIX%%/etc/raddb
|
2010-04-11 13:43:26 +02:00
|
|
|
required_dirs=`echo ${radiusd_flags} | sed -Ene 's:.*\-[^[:space:]d]*d[[:space:]]*([^[:space:]]+).*:\1:p'`
|
2007-12-06 11:01:02 +01:00
|
|
|
required_dirs=${required_dirs:-"%%PREFIX%%/etc/raddb"}
|
|
|
|
|
|
|
|
required_files="${required_dirs}/radiusd.conf"
|
|
|
|
|
2006-02-05 20:34:54 +01:00
|
|
|
radiusd_enable=${radiusd_enable-"NO"}
|
2004-08-29 04:18:42 +02:00
|
|
|
|
2010-04-11 13:43:26 +02:00
|
|
|
command_args="&"
|
2008-07-28 15:14:17 +02:00
|
|
|
|
|
|
|
radiusd_debug()
|
|
|
|
{
|
|
|
|
radiusd_flags="-X ${radiusd_flags}"
|
|
|
|
run_rc_command start
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-29 04:18:42 +02:00
|
|
|
run_rc_command "$1"
|