summaryrefslogtreecommitdiff
blob: 2fa9d977d8f4cf64aaf63ecd1b43663b6927f2fb (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
#!/sbin/runscript

depend() {
	need net
}

checkconfig() {
	if [ ! -f /etc/ndsad.conf ] ; then
		eerror "/etc/ndsad.conf does not file exists!"
		return 1
	fi
	
	return 0
}

start() {
	# Comment out the following line to get faster startups
	checkconfig || return 1

	ebegin "Starting ndsad"
	# On success ndsad returns 1.
	start-stop-daemon --start --quiet --exec /usr/sbin/ndsad -- -d ${NDSAD_OPTS} >/dev/null 2>&1
	eend $(( $? - 1 ))
}

stop () {
	ebegin "Stopping ndsad"
	start-stop-daemon --stop --quiet --pidfile=/var/run/ndsad.pid --retry 20 >/dev/null
	eend $?
}