~brightbox/bird/debian-packaging

« back to all changes in this revision

Viewing changes to misc/bird.init

  • Committer: Ondřej Surý
  • Date: 2013-11-25 14:59:24 UTC
  • Revision ID: git-v1:a3c058b8752bd98df2231ac88d94931fdb4e0c65
New upstream version 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
[ -f /etc/bird.conf ] || BIRD4="no"
26
 
[ -f /usr/sbin/bird ] || BIRD4="no"
27
 
[ "${NETWORKING}" = "yes" ] || BIRD4="no"
28
 
 
29
 
[ -f /etc/bird-6.conf ] || BIRD6="no"
30
 
[ -f /usr/sbin/bird6 ] || BIRD6="no"
31
 
[ "${NETWORKING_IPV6}" = "yes" ] || BIRD6="no"
32
 
 
33
 
RETVAL=0
34
 
 
35
 
# See how we were called.
36
 
case "$1" in
37
 
  start)
38
 
        if [ "$BIRD4" = "yes" ]
39
 
        then
40
 
                echo -n "Starting BIRD for IPv4: "
41
 
                daemon bird
42
 
                RETVAL=$?
43
 
                echo
44
 
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird
45
 
        fi
46
 
        if [ "$BIRD6" = "yes" ]
47
 
        then
48
 
                echo -n "Starting BIRD for IPv6: "
49
 
                daemon bird6
50
 
                RETVAL=$?
51
 
                echo
52
 
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird6
53
 
        fi
54
 
        ;;
55
 
  stop)
56
 
        echo -n "Stopping BIRD for IPv4: "
57
 
        killproc bird
58
 
        RETVAL=$?
59
 
        echo
60
 
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird
61
 
 
62
 
        echo -n "Stopping BIRD for IPv6: "
63
 
        killproc bird6
64
 
        RETVAL=$?
65
 
        echo
66
 
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bird6
67
 
        ;;
68
 
  status)
69
 
        status bird
70
 
        status bird6
71
 
        RETVAL=$?
72
 
        ;;
73
 
  restart)
74
 
        $0 stop
75
 
        $0 start
76
 
        RETVAL=$?
77
 
        ;;
78
 
  reload)
79
 
        killall -HUP bird
80
 
        killall -HUP bird6
81
 
        RETVAL=$?
82
 
        ;;
83
 
  *)
84
 
        echo "Usage: bird.init {start|stop|status|restart|reload}"
85
 
        exit 1
86
 
esac
87
 
 
88
 
exit $REVAL