iof-bird-daemon / misc / bird.init @ milani/bird-2.0.1
History | View | Annotate | Download (1.7 KB)
1 |
#! /bin/sh |
---|---|
2 |
# |
3 |
# bird Starts the Internet Routing Daemon. |
4 |
# |
5 |
# Author: Ondrej Feela Filip, <feela@network.cz> |
6 |
# |
7 |
# chkconfig: - 32 75 |
8 |
# description: Internet routing daemon supporting IPv4 routing protocols: |
9 |
# BGP4, RIPv2 and OSPFv2. |
10 |
# |
11 |
# processname: bird |
12 |
# config: /etc/bird.conf |
13 |
|
14 |
|
15 |
# Source function library. |
16 |
. /etc/rc.d/init.d/functions |
17 |
|
18 |
[ -f /etc/sysconfig/network ] || exit 0 |
19 |
|
20 |
. /etc/sysconfig/network |
21 |
|
22 |
BIRD4="yes" |
23 |
BIRD6="yes" |
24 |
|
25 |
BIRD4ARGS= |
26 |
BIRD6ARGS= |
27 |
|
28 |
[ -f /etc/bird.conf ] || BIRD4="no" |
29 |
[ -f /usr/sbin/bird ] || BIRD4="no" |
30 |
[ "${NETWORKING}" = "yes" ] || BIRD4="no" |
31 |
|
32 |
[ -f /etc/bird6.conf ] || BIRD6="no" |
33 |
[ -f /usr/sbin/bird6 ] || BIRD6="no" |
34 |
[ "${NETWORKING_IPV6}" = "yes" ] || BIRD6="no" |
35 |
|
36 |
[ -e /etc/sysconfig/bird ] && . /etc/sysconfig/bird |
37 |
|
38 |
RETVAL=0 |
39 |
|
40 |
# See how we were called. |
41 |
case "$1" in |
42 |
start) |
43 |
if [ "$BIRD4" = "yes" ] |
44 |
then |
45 |
echo -n "Starting BIRD for IPv4: " |
46 |
daemon bird ${BIRD4ARGS} |
47 |
RETVAL=$? |
48 |
echo |
49 |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird |
50 |
fi |
51 |
if [ "$BIRD6" = "yes" ] |
52 |
then |
53 |
echo -n "Starting BIRD for IPv6: " |
54 |
daemon bird6 ${BIRD6ARGS} |
55 |
RETVAL=$? |
56 |
echo |
57 |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird6 |
58 |
fi |
59 |
;; |
60 |
stop) |
61 |
echo -n "Stopping BIRD for IPv4: " |
62 |
killproc bird |
63 |
RETVAL=$? |
64 |
echo |
65 |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird |
66 |
|
67 |
echo -n "Stopping BIRD for IPv6: " |
68 |
killproc bird6 |
69 |
RETVAL=$? |
70 |
echo |
71 |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird6 |
72 |
;; |
73 |
status) |
74 |
status bird |
75 |
status bird6 |
76 |
RETVAL=$? |
77 |
;; |
78 |
restart) |
79 |
$0 stop |
80 |
$0 start |
81 |
RETVAL=$? |
82 |
;; |
83 |
reload) |
84 |
killproc bird -HUP |
85 |
RETVAL=$? |
86 |
echo |
87 |
echo -n "Reloading BIRD for IPv6: " |
88 |
killproc bird6 -HUP |
89 |
RETVAL=$? |
90 |
echo |
91 |
;; |
92 |
*) |
93 |
echo "Usage: bird.init {start|stop|status|restart|reload}" |
94 |
exit 1 |
95 |
esac |
96 |
|
97 |
exit $RETVAL |