all: check return value from daemon() call
[jleu-quagga.git] / redhat / ripd.init
blob766422194d003f633a5e934d3f031b133ba1b30d
1 #!/bin/bash
3 # chkconfig: 2345 16 84
4 # description: A RIP routing engine for use with Zebra
6 # processname: ripd
7 # config: /etc/quagga/ripd.conf
9 # source function library
10 . /etc/rc.d/init.d/functions
12 # Get network config
13 . /etc/sysconfig/network
15 # quagga command line options
16 . /etc/sysconfig/quagga
18 # Check that networking is up.
19 [ "${NETWORKING}" = "no" ] && exit 0
21 # The process must be configured first.
22 [ -f /etc/quagga/ripd.conf ] || exit 0
24 RETVAL=0
25 prog="ripd"
27 case "$1" in
28 start)
29 echo -n $"Starting $prog: "
30 daemon /usr/sbin/ripd -d $RIPD_OPTS
31 RETVAL=$?
32 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd
33 echo
35 stop)
36 echo -n $"Shutting down $prog: "
37 killproc ripd
38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripd
40 echo
42 restart|reload)
43 $0 stop
44 $0 start
45 RETVAL=$?
47 condrestart)
48 if [ -f /var/lock/subsys/ripd ]; then
49 $0 stop
50 $0 start
52 RETVAL=$?
54 status)
55 status ripd
56 RETVAL=$?
59 echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
60 exit 1
61 esac
63 exit $RETVAL