blob: 8caae1f167345cb9232bdfdd5ac9272c6fd5b9f8 [file] [log] [blame]
paul788cdc62003-01-18 00:22:08 +00001#!/bin/bash
2#
paul15d74e92003-12-30 11:16:21 +00003# chkconfig: 2345 15 85
paul788cdc62003-01-18 00:22:08 +00004# 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
paul15d74e92003-12-30 11:16:21 +000012# quagga command line options
13. /etc/sysconfig/quagga
14
paul788cdc62003-01-18 00:22:08 +000015# Check that networking is up.
16[ "${NETWORKING}" = "no" ] && exit 0
17
18# The process must be configured first.
paule835d102003-08-14 05:24:30 +000019[ -f /etc/quagga/zebra.conf ] || exit 0
paul788cdc62003-01-18 00:22:08 +000020
21RETVAL=0
22
23prog="zebra"
24
25case "$1" in
26 start)
27 echo -n $"Starting $prog: "
28
29 /sbin/ip route flush proto zebra
30
paul15d74e92003-12-30 11:16:21 +000031 daemon /usr/sbin/zebra -d $ZEBRA_OPTS
paul788cdc62003-01-18 00:22:08 +000032 RETVAL=$?
33 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
34 echo
35 ;;
36 stop)
37 echo -n $"Shutting down $prog: "
38 killproc zebra
39 RETVAL=$?
40 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra
41 echo
42 ;;
43 restart|reload)
44 $0 stop
45 $0 start
46 RETVAL=$?
47 ;;
48 condrestart)
49 if [ -f /var/lock/subsys/zebra ]; then
50 $0 stop
51 $0 start
52 fi
53 RETVAL=$?
54 ;;
55 status)
56 status zebra
57 RETVAL=$?
58 ;;
59 *)
60 echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
61 exit 1
62esac
63
64exit $RETVAL