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