diff options
Diffstat (limited to 'net-misc/zebra/files/init.d/bgpd.initd')
-rw-r--r-- | net-misc/zebra/files/init.d/bgpd.initd | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/net-misc/zebra/files/init.d/bgpd.initd b/net-misc/zebra/files/init.d/bgpd.initd new file mode 100644 index 000000000000..59e012687d03 --- /dev/null +++ b/net-misc/zebra/files/init.d/bgpd.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/bgpd.initd,v 1.1 2003/05/31 19:57:55 solar 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/bgpd.conf first." + eerror "An example can be found in /etc/zebra/sample/bgpd.conf.sample" + return 1 + fi +} + +stop() { + ebegin "Stopping bgpd" + start-stop-daemon --stop --quiet --pidfile /var/run/bgpd.pid + result=$? + eend $result +} + +start() { + local myopts="--daemon" + + [ -n "${BGPD_CONFIG_FILE}" ] && myopts="${myopts} --config_file ${BGPD_CONFIG_FILE}" + [ -n "${BGPD_BGP_PORT}" ] && [ "${BGPD_BGP_PORT}" -ge 0 ] && myopts="${myopts} --bgp_port ${BGPD_BGP_PORT}" + [ -n "${BGPD_VTY_ADDR}" ] && myopts="${myopts} --vty_addr ${BGPD_VTY_ADDR}" + [ -n "${BGPD_VTY_PORT}" ] && [ "${BGPD_VTY_PORT}" -ge 0 ] && myopts="${myopts} --vty_port ${BGPD_VTY_PORT}" + [ "x${BGPD_RETAIN}" == "xyes" ] && myopts="${myopts} --retain" + [ "x${BGPD_NO_KERNEL}" == "xyes" ] && myopts="${myopts} --keep_kernel" + + ebegin "Starting bgpd" + start-stop-daemon --start --quiet --exec /usr/sbin/bgpd -- ${myopts} + result=$? + eend $result +} |