File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / quagga / redhat / bgpd.init
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Oct 9 09:22:29 2012 UTC (11 years, 8 months ago) by misho
Branches: quagga, MAIN
CVS tags: v1_0_20160315, v0_99_22p0, v0_99_22, v0_99_21, HEAD
quagga

#!/bin/bash
# chkconfig: - 16 84
# config: /etc/quagga/bgpd.conf

### BEGIN INIT INFO
# Provides: bgpd
# Short-Description: BGP routing engine
# Description: BGP routing engine for use with Zebra
### END INIT INFO

# source function library
. /etc/rc.d/init.d/functions

# Get network config
. /etc/sysconfig/network

# quagga command line options
. /etc/sysconfig/quagga

RETVAL=0
PROG="bgpd"
cmd=bgpd
LOCK_FILE=/var/lock/subsys/bgpd
CONF_FILE=/etc/quagga/bgpd.conf

case "$1" in
  start)
	# Check that networking is up.
	[ "${NETWORKING}" = "no" ] && exit 1

	# The process must be configured first.
	[ -f $CONF_FILE ] || exit 6
	if [ `id -u` -ne 0 ]; then
		echo $"Insufficient privilege" 1>&2
		exit 4
	fi

	echo -n $"Starting $PROG: "
	daemon $cmd -d $BGPD_OPTS -f $CONF_FILE
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch $LOCK_FILE
	echo
	;;
  stop)
	echo -n $"Shutting down $PROG: "
	killproc $cmd
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
	echo
	;;
  restart|reload|force-reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  condrestart|try-restart)
	if [ -f $LOCK_FILE ]; then
		$0 stop
		$0 start
	fi
	RETVAL=$?
	;;
  status)
	status $cmd
	RETVAL=$?
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
	exit 2
esac

exit $RETVAL

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>