File: rc.radiusd

package info (click to toggle)
xtradius 1.2.1-beta2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,252 kB
  • ctags: 921
  • sloc: ansic: 10,181; perl: 733; sh: 260; makefile: 149; sql: 21
file content (74 lines) | stat: -rw-r--r-- 1,820 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
#
# radiusd	Start the radius daemon.
#
#		This is a script suitable for the Debian Linux distribution.
#		Copy it to /etc/init.d/radiusd, make it executable, and
#		execute "update-rc.d radiusd defaults 50".
#

RADIUSD=/usr/local/sbin/radiusd
RADRELAY=/usr/local/sbin/radrelay
DESC="Cistron radius server"
NAME1=radiusd
NAME2=radrelay

# These are the defaults.
RADIUS_ARGS="-y"

# This is useful if you want to replicate accounting packets
# to another radius server - see README.radrelay
#RADIUS_ARGS="-y -w -F %N/detail -F detail.rep"
#RADRELAY_ARGS="-a /var/log/radacct XX.SERVER.HERE.XX detail.rep"

test -f $RADIUSD || exit 0

case "$1" in
  start)
	if [ ! -f /var/log/radutmp ]
	then
		:>/var/log/radutmp
	fi
	echo -n "Starting $DESC:"
	if [ -x "$RADRELAY" ] &&[ -n "$RADRELAY_ARGS" ]
	then
		echo -n " radrelay"
		start-stop-daemon --start --quiet \
			--pidfile /var/run/$NAME2.pid \
			--exec $RADRELAY -- $RADRELAY_ARGS
	fi
	echo -n " radiusd"
	start-stop-daemon --start --quiet \
		--pidfile /var/run/$NAME1.pid \
		--exec $RADIUSD -- $RADIUS_ARGS
	echo "."
	;;
  stop)
	[ -z "$2" ] && echo -n "Stopping $DESC:"
	if [ -x "$RADRELAY" ] &&[ -n "$RADRELAY_ARGS" ]
	then
		[ -z "$2" ] && echo -n " radrelay"
		start-stop-daemon --stop --quiet \
			--pidfile /var/run/$NAME2.pid --exec $RADRELAY
	fi
	[ -z "$2" ] && echo -n " radiusd"
	start-stop-daemon --stop --quiet \
		--pidfile /var/run/$NAME1.pid --exec $RADIUSD
	[ -z "$2" ] && echo "."
	;;
  reload|force-reload)
	echo "Reloading $DESC configuration files."
	start-stop-daemon --stop --signal 1 --quiet --pidfile \
		/var/run/$NAME1.pid --exec $RADIUSD
	;;
  restart)
	sh /etc/init.d/radiusd stop quiet
	sleep 3
	/etc/init.d/radiusd start
	;;
  *)
        echo "Usage: /etc/init.d/$NAME1 {start|stop|reload|restart}"
        exit 1
esac

exit 0