blob: 16b7a499ff18fcf29e72c939e2a3b4ee1ae62368 [file] [log] [blame]
paul788cdc62003-01-18 00:22:08 +00001#!/bin/bash
2#
3# chkconfig: - 15 85
4# description: GNU Zebra routing manager
5#
6# processname: zebra
paule835d102003-08-14 05:24:30 +00007# config: /etc/quagga/zebra.conf
paul788cdc62003-01-18 00:22:08 +00008
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.
paule835d102003-08-14 05:24:30 +000016[ -f /etc/quagga/zebra.conf ] || exit 0
paul788cdc62003-01-18 00:22:08 +000017
18RETVAL=0
19
20prog="zebra"
21
22case "$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
59esac
60
61exit $RETVAL