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