0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00
bird/misc/bird.init

89 lines
1.5 KiB
Plaintext
Raw Normal View History

2000-08-24 20:08:00 +00:00
#! /bin/sh
#
# bird Starts the Internet Routing Daemon.
2000-08-24 20:08:00 +00: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 14:38:35 +00:00
[ -f /etc/sysconfig/network ] || exit 0
2000-08-24 20:08:00 +00:00
2004-06-07 14:38:35 +00:00
. /etc/sysconfig/network
2000-08-24 20:08:00 +00:00
2004-06-07 14:38:35 +00:00
BIRD4="yes"
BIRD6="yes"
[ -f /etc/bird.conf ] || BIRD4="no"
[ -f /usr/sbin/bird ] || BIRD4="no"
[ "${NETWORKING}" = "yes" ] || BIRD4="no"
[ -f /etc/bird-6.conf ] || BIRD6="no"
[ -f /usr/sbin/bird6 ] || BIRD6="no"
[ "${NETWORKING_IPV6}" = "yes" ] || BIRD6="no"
2000-08-24 20:08:00 +00:00
RETVAL=0
# See how we were called.
case "$1" in
start)
2004-06-07 14:38:35 +00: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-24 20:08:00 +00:00
;;
stop)
2004-06-07 14:38:35 +00:00
echo -n "Stopping BIRD for IPv4: "
2000-08-24 20:08:00 +00:00
killproc bird
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird
2004-06-07 14:38:35 +00:00
echo -n "Stopping BIRD for IPv6: "
killproc bird6
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird6
2000-08-24 20:08:00 +00:00
;;
status)
status bird
2004-06-07 14:38:35 +00:00
status bird6
2000-08-24 20:08:00 +00:00
RETVAL=$?
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
reload)
killall -HUP bird
2004-06-07 14:38:35 +00:00
killall -HUP bird6
2000-08-24 20:08:00 +00:00
RETVAL=$?
;;
*)
echo "Usage: bird.init {start|stop|status|restart|reload}"
exit 1
esac
exit $REVAL