Statistics
| Branch: | Revision:

iof-bird-daemon / misc / bird.init @ milani/bird-2.0.1

History | View | Annotate | Download (1.7 KB)

1 6cf7e97a Ondrej Filip
#! /bin/sh
2
#
3 482bbc73 Ondrej Filip
# bird         Starts the Internet Routing Daemon.
4 6cf7e97a Ondrej Filip
#
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 6721e286 Ondrej Filip
[ -f /etc/sysconfig/network ] || exit 0
19 6cf7e97a Ondrej Filip
20 6721e286 Ondrej Filip
. /etc/sysconfig/network
21 6cf7e97a Ondrej Filip
22 6721e286 Ondrej Filip
BIRD4="yes"
23
BIRD6="yes"
24
25 300e4008 Ondrej Filip
BIRD4ARGS=
26
BIRD6ARGS=
27
28 6721e286 Ondrej Filip
[ -f /etc/bird.conf ] || BIRD4="no"
29
[ -f /usr/sbin/bird ] || BIRD4="no"
30
[ "${NETWORKING}" = "yes" ] || BIRD4="no"
31
32 e9e6fbf9 Ondrej Filip
[ -f /etc/bird6.conf ] || BIRD6="no"
33 6721e286 Ondrej Filip
[ -f /usr/sbin/bird6 ] || BIRD6="no"
34
[ "${NETWORKING_IPV6}" = "yes" ] || BIRD6="no"
35 6cf7e97a Ondrej Filip
36 300e4008 Ondrej Filip
[ -e /etc/sysconfig/bird ] && . /etc/sysconfig/bird
37
38 6cf7e97a Ondrej Filip
RETVAL=0
39
40
# See how we were called.
41
case "$1" in
42
  start)
43 6721e286 Ondrej Filip
	if [ "$BIRD4" = "yes" ]
44
	then
45
		echo -n "Starting BIRD for IPv4: "
46 300e4008 Ondrej Filip
		daemon bird ${BIRD4ARGS}
47 6721e286 Ondrej Filip
		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 300e4008 Ondrej Filip
		daemon bird6 ${BIRD6ARGS}
55 6721e286 Ondrej Filip
		RETVAL=$?
56
		echo
57
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird6
58
	fi
59 6cf7e97a Ondrej Filip
	;;
60
  stop)
61 6721e286 Ondrej Filip
	echo -n "Stopping BIRD for IPv4: "
62 6cf7e97a Ondrej Filip
	killproc bird
63
	RETVAL=$?
64
	echo
65
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird
66 6721e286 Ondrej Filip
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 6cf7e97a Ondrej Filip
	;;
73
  status)
74
	status bird
75 6721e286 Ondrej Filip
	status bird6
76 6cf7e97a Ondrej Filip
	RETVAL=$?
77
	;;
78
  restart)
79
  	$0 stop
80
	$0 start
81
	RETVAL=$?
82
	;;
83
  reload)
84 e9e6fbf9 Ondrej Filip
	killproc bird -HUP
85
 	RETVAL=$?
86
	echo
87
	echo -n "Reloading BIRD for IPv6: "
88
	killproc bird6 -HUP
89 6cf7e97a Ondrej Filip
	RETVAL=$?
90 e9e6fbf9 Ondrej Filip
	echo
91 6cf7e97a Ondrej Filip
	;;
92
  *)
93
	echo "Usage: bird.init {start|stop|status|restart|reload}"
94
	exit 1
95
esac
96
97 e9e6fbf9 Ondrej Filip
exit $RETVAL