aboutsummaryrefslogtreecommitdiffstats
path: root/main/quagga/zebra.initd
blob: 3f224c370977898cca06f95effc448d171c2b7e7 (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
#!/sbin/runscript

piddir=/var/run/quagga
pidfile=$piddir/$SVCNAME.pid
command=/usr/sbin/$SVCNAME
command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile"

depend() {
	need net
	after firewall opennhrp
}

cleanup() {
	ebegin "Cleaning up stale zebra routes..."
	ip route flush proto zebra
	eend $?
}

checkconfig() {
	if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then
		eerror "You need to create /etc/quagga/$SVCNAME.conf first."
		eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample"
		eerror "from quagga-doc package"
		return 1
	fi
	return 0
}

start_pre() {
	checkconfig || return 1
	checkpath --owner quagga:quagga --directory $piddir
	cleanup
}