bird/misc/bird.init

93 lines
1.6 KiB
Text
Raw Normal View History

2000-08-25 04:08:00 +08:00
#! /bin/sh
#
# bird Starts the Internet Routing Daemon.
2000-08-25 04:08:00 +08:00
#
# Author: Ondrej Feela Filip, <feela@network.cz>
#
# chkconfig: - 32 75
# description: Internet routing daemon supporting IPv4 routing protocols:
# BGP4, RIPv2 and OSPFv2.
#
# processname: bird
# config: /etc/bird.conf
# Source function library.
. /etc/rc.d/init.d/functions
2004-06-07 22:38:35 +08:00
[ -f /etc/sysconfig/network ] || exit 0
2000-08-25 04:08:00 +08:00
2004-06-07 22:38:35 +08:00
. /etc/sysconfig/network
2000-08-25 04:08:00 +08:00
2004-06-07 22:38:35 +08:00
BIRD4="yes"
BIRD6="yes"
[ -f /etc/bird.conf ] || BIRD4="no"
[ -f /usr/sbin/bird ] || BIRD4="no"
[ "${NETWORKING}" = "yes" ] || BIRD4="no"
2014-02-05 22:57:37 +08:00
[ -f /etc/bird6.conf ] || BIRD6="no"
2004-06-07 22:38:35 +08:00
[ -f /usr/sbin/bird6 ] || BIRD6="no"
[ "${NETWORKING_IPV6}" = "yes" ] || BIRD6="no"
2000-08-25 04:08:00 +08:00
RETVAL=0
# See how we were called.
case "$1" in
start)
2004-06-07 22:38:35 +08:00
if [ "$BIRD4" = "yes" ]
then
echo -n "Starting BIRD for IPv4: "
daemon bird
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird
fi
if [ "$BIRD6" = "yes" ]
then
echo -n "Starting BIRD for IPv6: "
daemon bird6
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird6
fi
2000-08-25 04:08:00 +08:00
;;
stop)
2004-06-07 22:38:35 +08:00
echo -n "Stopping BIRD for IPv4: "
2000-08-25 04:08:00 +08:00
killproc bird
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird
2004-06-07 22:38:35 +08:00
echo -n "Stopping BIRD for IPv6: "
killproc bird6
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird6
2000-08-25 04:08:00 +08:00
;;
status)
status bird
2004-06-07 22:38:35 +08:00
status bird6
2000-08-25 04:08:00 +08:00
RETVAL=$?
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
reload)
2014-02-05 22:57:37 +08:00
killproc bird -HUP
RETVAL=$?
echo
echo -n "Reloading BIRD for IPv6: "
killproc bird6 -HUP
2000-08-25 04:08:00 +08:00
RETVAL=$?
2014-02-05 22:57:37 +08:00
echo
2000-08-25 04:08:00 +08:00
;;
*)
echo "Usage: bird.init {start|stop|status|restart|reload}"
exit 1
esac
2014-02-05 22:57:37 +08:00
exit $RETVAL