paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 3 | # chkconfig: 2345 16 84 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 4 | # description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra |
| 5 | # |
| 6 | # processname: bgpd |
| 7 | # config: /etc/zebra/bgpd.conf |
| 8 | |
| 9 | # source function library |
| 10 | . /etc/rc.d/init.d/functions |
| 11 | |
| 12 | # Get network config |
| 13 | . /etc/sysconfig/network |
| 14 | |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 15 | # quagga command line options |
| 16 | . /etc/sysconfig/quagga |
| 17 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 18 | # Check that networking is up. |
| 19 | [ "${NETWORKING}" = "no" ] && exit 0 |
| 20 | |
| 21 | # The process must be configured first. |
paul | e835d10 | 2003-08-14 05:24:30 +0000 | [diff] [blame] | 22 | [ -f /etc/quagga/bgpd.conf ] || exit 0 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 23 | |
| 24 | RETVAL=0 |
| 25 | prog="bgpd" |
| 26 | |
| 27 | case "$1" in |
| 28 | start) |
| 29 | echo -n $"Starting $prog: " |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 30 | daemon /usr/sbin/bgpd -d $BGPD_OPTS |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 31 | RETVAL=$? |
| 32 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd |
| 33 | echo |
| 34 | ;; |
| 35 | stop) |
| 36 | echo -n $"Shutting down $prog: " |
| 37 | killproc bgpd |
| 38 | RETVAL=$? |
| 39 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd |
| 40 | echo |
| 41 | ;; |
| 42 | restart|reload) |
| 43 | $0 stop |
| 44 | $0 start |
| 45 | RETVAL=$? |
| 46 | ;; |
| 47 | condrestart) |
| 48 | if [ -f /var/lock/subsys/bgpd ]; then |
| 49 | $0 stop |
| 50 | $0 start |
| 51 | fi |
| 52 | RETVAL=$? |
| 53 | ;; |
| 54 | status) |
| 55 | status bgpd |
| 56 | RETVAL=$? |
| 57 | ;; |
| 58 | *) |
| 59 | echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" |
| 60 | exit 1 |
| 61 | esac |
| 62 | |
| 63 | exit $RETVAL |