]>
Commit | Line | Data |
---|---|---|
c53170db JK |
1 | #!/bin/sh |
2 | # | |
3 | # bird Starts the Dynamic Route Daemon | |
4 | # | |
5 | # chkconfig: 345 80 45 | |
6 | # | |
7 | # description: Dynamic Route Daemon for IPv4 routers | |
8 | # | |
9 | # processname: bird-ipv4 | |
10 | # config: /etc/bird.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/bird-ipv4 ] && . /etc/sysconfig/bird-ipv4 | |
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 bird | |
26 | exit 1 | |
27 | fi | |
28 | else | |
29 | exit 0 | |
30 | fi | |
31 | ||
32 | # Sanity checks. | |
33 | [ -f /etc/bird.conf ] || exit 0 | |
34 | ||
35 | RETVAL=0 | |
36 | # See how we were called. | |
37 | case "$1" in | |
38 | start) | |
39 | # Check if the services are already running? | |
40 | if [ ! -f /var/lock/subsys/bird-ipv4 ]; then | |
41 | msg_starting "bird for IPv4" | |
42 | daemon ${SERVICE_RUN_NICE_LEVEL} bird | |
43 | RETVAL=$? | |
44 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird-ipv4 | |
45 | else | |
46 | msg_already_running "bird for IPv4" | |
47 | fi | |
48 | ;; | |
49 | stop) | |
50 | # Stop daemons. | |
51 | if [ -f /var/lock/subsys/bird-ipv4 ]; then | |
52 | msg_stopping "bird for IPv4" | |
53 | killproc bird | |
54 | rm -f /var/lock/subsys/bird-ipv4 | |
55 | else | |
56 | msg_not_running "bird for IPv4" | |
57 | fi | |
58 | ;; | |
59 | status) | |
60 | status bird-ipv4 bird | |
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 |