summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/zebra/files/init.d/zebra.initd')
-rw-r--r--net-misc/zebra/files/init.d/zebra.initd42
1 files changed, 42 insertions, 0 deletions
diff --git a/net-misc/zebra/files/init.d/zebra.initd b/net-misc/zebra/files/init.d/zebra.initd
new file mode 100644
index 000000000000..927847c30f8c
--- /dev/null
+++ b/net-misc/zebra/files/init.d/zebra.initd
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zebra/files/init.d/zebra.initd,v 1.1 2003/05/31 19:57:55 solar Exp $
+
+
+opts="depend checkconfig stop start"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -e /etc/zebra/zebra.conf ]; then
+ eerror "You need to create /etc/zebra/zebra.conf first."
+ eerror "An example can be found in /etc/zebra/sample/zebra.conf.sample"
+ return 1
+ fi
+}
+
+stop() {
+ ebegin "Stopping zebra"
+ start-stop-daemon --stop --quiet --pidfile /var/run/zebra.pid
+ result=$?
+ eend $result
+}
+
+start() {
+ local myopts="--daemon"
+
+ [ -n "${ZEBRA_CONFIG_FILE}" ] && myopts="${myopts} --config_file ${ZEBRA_CONFIG_FILE}"
+ [ "x${ZEBRA_KEEP_KERNEL}" == "xyes" ] && myopts="${myopts} --keep_kernel"
+ [ -n "${ZEBRA_LOG_MODE}" ] && [ "${ZEBRA_LOG_MODE}" -ge 0 ] && myopts="${myopts} --log_mode ${ZEBRA_LOG_MODE}"
+ [ -n "${ZEBRA_VTY_ADDR}" ] && myopts="${myopts} --vty_addr ${ZEBRA_VTY_ADDR}"
+ [ -n "${ZEBRA_VTY_PORT}" ] && [ "${ZEBRA_VTY_PORT}" -ge 0 ] && myopts="${myopts} --vty_port ${ZEBRA_VTY_PORT}"
+ [ "x${ZEBRA_RETAIN}" == "xyes" ] && myopts="${myopts} --retain"
+
+ ebegin "Starting zebra"
+ start-stop-daemon --start --quiet --exec /usr/sbin/zebra -- ${myopts}
+ result=$?
+ eend $result
+}