aboutsummaryrefslogtreecommitdiffstats
path: root/main/freeradius/freeradius.initd
blob: 5412d2b31c1d728311130a49868886ed37fa15b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/sbin/openrc-run

extra_started_commands="reload"
run_dir="/var/run/radiusd"
command="/usr/sbin/radiusd"
command_args="$RADIUSD_OPTS"
pidfile="$run_dir/radiusd.pid"
name="Freeradius"
conf="/etc/raddb/radiusd.conf"
user="$(grep -v '#' $conf | grep 'user =' | awk -F " = " '{ print $2 }')"
group="$(grep -v '#' $conf |grep 'group =' | awk -F " = " '{ print $2 }')"

depend() {
	need net
	after firewall
	use dns
}

start_pre() {
	checkpath --directory --owner ${user}:${group} --mode 0775 ${run_dir}
}

reload () {
	ebegin "Reloading $name"
	kill -HUP `cat $pidfile`
	eend $?
}