summaryrefslogtreecommitdiff
blob: 24b6c692982d89f11bb6d72a9176e6c7973fa8a9 (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
36
37
38
39
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/zebra/files/init.d/ospf6d.initd,v 1.2 2004/07/15 00:16:56 agriffis Exp $


opts="depend checkconfig stop start"

depend() {
	need net zebra
}

checkconfig() {
	if [ ! -e /etc/zebra/zebra.conf ]; then
		eerror "You need to create /etc/zebra/ospf6d.conf first."
		eerror "An example can be found in /etc/zebra/sample/ospf6d.conf.sample"
		return 1
	fi
}

stop() {
	ebegin "Stopping ospf6d"
	start-stop-daemon --stop --quiet --pidfile /var/run/ospf6d.pid
	result=$?
	eend $result
}

start() {
	local myopts="--daemon"

	[ -n "${OSPF6D_CONFIG_FILE}" ] && myopts="${myopts} --config_file ${OSPF6D_CONFIG_FILE}"
	[ -n "${OSPF6D_VTY_ADDR}" ] && myopts="${myopts} --vty_addr ${OSPF6D_VTY_ADDR}"
	[ -n "${OSPF6D_VTY_PORT}" ] && [ "${OSPF6D_VTY_PORT}" -ge 0 ] && myopts="${myopts} --vty_port ${OSPF6D_VTY_PORT}"

	ebegin "Starting ospf6d"
	start-stop-daemon --start --quiet --exec /usr/sbin/ospf6d -- ${myopts}
	result=$?
	eend $result
}