Logoj0ke.net Open Build Service > Projects > server:routing > bird > bird.init
Sign Up | Log In

File bird.init of Package bird (Revision e75def79a24add163d294f2af7aa723f)

Currently displaying revision e75def79a24add163d294f2af7aa723f, show latest

x
 
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
### BEGIN INIT INFO
14
# Provides: bird
15
# Required-Start: $network $remote_fs
16
# Required-Stop: $network $remote_fs
17
# Default-Start: 3 5
18
# Default-Stop: 0 1 2 6
19
# Description: Starts bird
20
### END INIT INFO
21
22
23
# Source function library.
24
. /etc/rc.d/init.d/functions
25
26
[ -f /etc/sysconfig/network ] || exit 0
27
28
. /etc/sysconfig/network
29
30
BIRD4="yes"
31
BIRD6="yes"
32
33
[ -f /etc/bird.conf ] || BIRD4="no"
34
[ -f /usr/sbin/bird ] || BIRD4="no"
35
[ "${NETWORKING}" = "yes" ] || BIRD4="no"
36
37
[ -f /etc/bird-6.conf ] || BIRD6="no"
38
[ -f /usr/sbin/bird6 ] || BIRD6="no"
39
[ "${NETWORKING_IPV6}" = "yes" ] || BIRD6="no"
40
41
RETVAL=0
42
43
# See how we were called.
44
case "$1" in
45
  start)
46
    if [ "$BIRD4" = "yes" ]
47
    then
48
        echo -n "Starting BIRD for IPv4: "
49
        daemon bird
50
        RETVAL=$?
51
        echo
52
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird
53
    fi
54
    if [ "$BIRD6" = "yes" ]
55
    then
56
        echo -n "Starting BIRD for IPv6: "
57
        daemon bird6
58
        RETVAL=$?
59
        echo
60
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird6
61
    fi
62
    ;;
63
  stop)
64
    echo -n "Stopping BIRD for IPv4: "
65
    killproc bird
66
    RETVAL=$?
67
    echo
68
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird
69
70
    echo -n "Stopping BIRD for IPv6: "
71
    killproc bird6
72
    RETVAL=$?
73
    echo
74
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird6
75
    ;;
76
  status)
77
    status bird
78
    status bird6
79
    RETVAL=$?
80
    ;;
81
  restart)
82
    $0 stop
83
    $0 start
84
    RETVAL=$?
85
    ;;
86
  reload)
87
    killall -HUP bird
88
    killall -HUP bird6
89
    RETVAL=$?
90
    ;;
91
  *)
92
    echo "Usage: bird.init {start|stop|status|restart|reload}"
93
    exit 1
94
esac
95
96
exit $REVAL
97