aboutsummaryrefslogtreecommitdiff
path: root/net/freeradius2/files/radiusd.sh
blob: 798339462cd167ce1666817771aede9a5fe37dbf (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
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# RADIUSD_FLAGS='-xxyzsf -l stdout'
RADIUSD_FLAGS=

if [ -r /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
	source_rc_confs
elif [ -r /etc/rc.conf ]; then
	. /etc/rc.conf
fi

prog=$(realpath $0) || exit 1
dir=${prog%/*}
PREFIX=${dir%/etc/rc.d}

if [ ."$dir" = ."$prog" -o ."$PREFIX" = ."$dir" ]
then
	echo "$0: Cannot determine the PREFIX" >&2
	exit 1
fi

case $1 in
start)
	"$PREFIX"/sbin/radiusd $RADIUSD_FLAGS && echo -n " radiusd"
	;;
stop)
	if [ -f /var/run/radiusd/radiusd.pid ]; then
		kill `cat /var/run/radiusd/radiusd.pid` && echo -n ' radiusd'
	fi
	;;
*)
	echo "Usage: `basename $0` {start|stop}" >&2
	exit 64
	;;
esac

exit 0