]> git.pld-linux.org Git - packages/quagga.git/blob - quagga-ospfd.init
- removed temporary files
[packages/quagga.git] / quagga-ospfd.init
1 #!/bin/sh
2 #
3 # ospfd         Starts the Dynamic Route Daemon
4 #
5 # chkconfig:    345 15 84
6 #
7 # description:  Dynamic Route Daemon for IPv4 and IPv6 routers
8 #
9 # processname:  ospfd
10 # config:       /etc/zebra/ospfd.conf
11
12
13 # Source function library
14 . /etc/rc.d/init.d/functions
15
16 # Get network config
17 . /etc/sysconfig/network
18
19 # Get service config
20 [ -f /etc/sysconfig/ospfd ] && . /etc/sysconfig/ospfd
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25                 msg_network_down ospfd
26                 exit 1
27         fi
28 else
29         exit 0
30 fi
31
32 RETVAL=0
33 # See how we were called.
34 case "$1" in
35   start)
36         # Check if the services are already running?
37         if [ ! -f /var/lock/subsys/ospfd ]; then
38                 FLAGS="--daemon"
39                 [ -n "$VTY_ADDR" ] && FLAGS="$FLAGS --vty_addr $VTY_ADDR"
40                 [ -n "$VTY_PORT" ] && FLAGS="$FLAGS --vty_port $VTY_PORT"
41                 msg_starting ospfd
42                 daemon ospfd $FLAGS
43                 RETVAL=$?
44                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd
45         else
46                 msg_already_running "ospfd"
47         fi
48         ;;
49   stop)
50         if [ -f /var/lock/subsys/ospfd ]; then
51                 # Stop daemons.
52                 msg_stopping "ospfd"
53                 killproc ospfd
54                 rm -f /var/lock/subsys/ospfd
55         else
56                 msg_not_running ospfd
57         fi
58         ;;
59   status)
60         status ospfd
61         exit $?
62         ;;
63   restart|force-reload)
64         $0 stop
65         $0 start
66         exit $?
67         ;;
68   *)
69         msg_usage "$0 {start|stop|restart|force-reload|status}"
70         exit 3
71 esac
72
73 exit $RETVAL
This page took 0.073489 seconds and 3 git commands to generate.