summaryrefslogtreecommitdiff
blob: cc4b7d3deb9e2252e7a768979637dc57bcfb5c6b (plain)
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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need net
}

checkconfig() {
	if [ ! -x /usr/sbin/radiusd ] ; then
		eerror "The radius daemon was not found."
		eerror "Please (re)emerge cistronradius."
		return 1
	fi

	if [ ! -e /etc/raddb/clients ] ; then
		eerror "No /etc/raddb/clients file found."
		eerror "Please create the file and retry."
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting Cistron Radius"
	start-stop-daemon --start --quiet --exec /usr/sbin/radiusd
	eend $?
}

stop() {
	ebegin "Stopping Cistron Radius"
	start-stop-daemon --stop --quiet --pidfile /var/run/radiusd.pid
	eend $?
}