Update net/freeradius2 to version 2.2.3_1
[dports.git] / net / freeradius2 / files / radiusd.in
1 #!/bin/sh
2 #
3 # $FreeBSD: net/freeradius2/files/radiusd.in 340872 2014-01-24 00:14:07Z mat $
4 #
5 # PROVIDE: radiusd
6 # REQUIRE: %%REQUIRE%%
7 # KEYWORD: shutdown
8 #
9 # Add the following lines to /etc/rc.conf to enable radiusd:
10 #
11 # radiusd_enable="YES"
12 #
13
14 . /etc/rc.subr
15
16 name=radiusd
17 rcvar=radiusd_enable
18 load_rc_config $name
19
20 command=%%PREFIX%%/sbin/radiusd
21
22 # In debug mode, radiusd doesn't create a pid file, so comment pidfile and
23 # let rc.subr use a process check on procname (which defaults to command).
24 #pidfile=/var/run/radiusd/radiusd.pid
25
26 extra_commands="reload debug"
27 debug_cmd="radiusd_debug"
28
29
30 # The radiusd_config parameter is now obsolete. Instead, derive the
31 # configuration directory name from radiusd_flags if possible, otherwise
32 # default to %%PREFIX%%/etc/raddb
33 required_dirs=`echo ${radiusd_flags} | sed -Ene 's:.*\-[^[:space:]d]*d[[:space:]]*([^[:space:]]+).*:\1:p'`
34 required_dirs=${required_dirs:-"%%PREFIX%%/etc/raddb"}
35
36 required_files="${required_dirs}/radiusd.conf"
37
38 radiusd_enable=${radiusd_enable-"NO"}
39
40 command_args="&"
41
42 radiusd_debug()
43 {
44     radiusd_flags="-X ${radiusd_flags}"
45     run_rc_command start
46 }
47
48
49 run_rc_command "$1"