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: An OSPF v2 routing engine for use with Zebra |
| 5 | # |
| 6 | # processname: ospfd |
paul | e835d10 | 2003-08-14 05:24:30 +0000 | [diff] [blame] | 7 | # config: /etc/quagga/ospfd.conf |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 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/ospfd.conf ] || exit 0 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 23 | |
| 24 | RETVAL=0 |
| 25 | |
| 26 | prog="ospfd" |
| 27 | |
| 28 | case "$1" in |
| 29 | start) |
| 30 | echo -n $"Starting $prog: " |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 31 | daemon /usr/sbin/ospfd -d $OSPFD_OPTS |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 32 | RETVAL=$? |
| 33 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd |
| 34 | echo |
| 35 | ;; |
| 36 | stop) |
| 37 | echo -n $"Shutting down $prog: " |
| 38 | killproc ospfd |
| 39 | RETVAL=$? |
| 40 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospfd |
| 41 | echo |
| 42 | ;; |
| 43 | restart|reload) |
| 44 | $0 stop |
| 45 | $0 start |
| 46 | RETVAL=$? |
| 47 | ;; |
| 48 | condrestart) |
| 49 | if [ -f /var/lock/subsys/ospfd ]; then |
| 50 | $0 stop |
| 51 | $0 start |
| 52 | fi |
| 53 | RETVAL=$? |
| 54 | ;; |
| 55 | status) |
| 56 | status ospfd |
| 57 | RETVAL=$? |
| 58 | ;; |
| 59 | *) |
| 60 | echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" |
| 61 | exit 1 |
| 62 | esac |
| 63 | |
| 64 | exit $RETVAL |