paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # chkconfig: - 16 84 |
| 4 | # description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra |
| 5 | # |
| 6 | # processname: bgpd |
| 7 | # config: /etc/bgpd.conf |
| 8 | |
| 9 | # source function library |
| 10 | . /etc/rc.d/init.d/functions |
| 11 | |
| 12 | RETVAL=0 |
| 13 | |
| 14 | [ -f /etc/bgpd.conf ] || exit 0 |
| 15 | |
| 16 | case "$1" in |
| 17 | start) |
| 18 | echo -n "Starting bgpd: " |
| 19 | daemon /usr/sbin/bgpd -d |
| 20 | RETVAL=$? |
| 21 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd |
| 22 | echo |
| 23 | ;; |
| 24 | stop) |
| 25 | echo -n "Shutting down bgpd: " |
| 26 | killproc bgpd |
| 27 | RETVAL=$? |
| 28 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd |
| 29 | echo |
| 30 | ;; |
| 31 | restart) |
| 32 | $0 stop |
| 33 | $0 start |
| 34 | RETVAL=$? |
| 35 | ;; |
| 36 | status) |
| 37 | status bgpd |
| 38 | RETVAL=$? |
| 39 | ;; |
| 40 | *) |
| 41 | echo "Usage: bgpd {start|stop|restart|status}" |
| 42 | exit 1 |
| 43 | esac |
| 44 | |
| 45 | exit $RETVAL |