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