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

File bird.init.suse of Package bird (Revision cf3e499abcfe71aaaf3688e89fcdd982)

Currently displaying revision cf3e499abcfe71aaaf3688e89fcdd982, 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
BIRD_SYSCONFIG=/etc/sysconfig/bird
23
test -r $BIRD_SYSCONFIG || exit 6
24
. $BIRD_SYSCONFIG
25
26
BIRD4_PIDFILE=/var/run/bird4.init.pid
27
BIRD6_PIDFILE=/var/run/bird6.init.pid
28
BIRD4_BIN=/usr/sbin/bird
29
BIRD6_BIN=/usr/sbin/bird6
30
. /etc/rc.status
31
32
# Shell functions sourced from /etc/rc.status:
33
#      rc_check         check and set local and overall rc status
34
#      rc_status        check and set local and overall rc status
35
#      rc_status -v     ditto but be verbose in local rc status
36
#      rc_status -v -r  ditto and clear the local rc status
37
#      rc_failed        set local and overall rc status to failed
38
#      rc_reset         clear local rc status (overall remains)
39
#      rc_exit          exit appropriate to overall rc status
40
41
# First reset status of this service
42
rc_reset
43
44
BIRD4="yes"
45
BIRD6="yes"
46
47
[ -f /etc/bird.conf ] || BIRD4="no"
48
[ -f "${BIRD4_BIN}" ] || BIRD4="no"
49
50
[ -f /etc/bird-6.conf ] || BIRD6="no"
51
[ -f "${BIRD6_BIN}" ] || BIRD6="no"
52
53
# See how we were called.
54
case "$1" in
55
  start)
56
    if [ "$BIRD4" = "yes" ]
57
    then
58
        echo -n "Starting BIRD for IPv4: "
59
        startproc -f -p $BIRD4_PIDFILE $BIRD4_BIN $BIRD4_OPTS
60
        rc_status -v
61
    fi
62
    if [ "$BIRD6" = "yes" ]
63
    then
64
        echo -n "Starting BIRD for IPv6: "
65
        startproc -f -p $BIRD6_PIDFILE $BIRD6_BIN $BIRD6_OPTS
66
        rc_status -v
67
    fi
68
    ;;
69
  stop)
70
    echo -n "Stopping BIRD for IPv4: "
71
    killproc -p $BIRD4_PIDFILE $BIRD4_BIN
72
    rc_status -v
73
74
    echo -n "Stopping BIRD for IPv6: "
75
    killproc -p $BIRD6_PIDFILE $BIRD6_BIN
76
    rc_status -v
77
    ;;
78
  status)
79
    echo -n "Checking BIRD for IPv4: "
80
    checkproc -p $BIRD4_PIDFILE $BIRD4_BIN
81
    rc_status -v
82
    echo -n "Checking BIRD for IPv6: "
83
    checkproc -p $BIRD6_PIDFILE $BIRD6_BIN
84
    rc_status -v
85
    ;;
86
  restart)
87
    $0 stop
88
    $0 start
89
    ;;
90
  reload)
91
    echo -n "Reloading BIRD for IPv4: "
92
    killproc -p $BIRD4_PIDFILE -HUP $BIRD4_BIN
93
    rc_status -v
94
    echo -n "Reloading BIRD for IPv6: "
95
    killproc -p $BIRD6_PIDFILE -HUP $BIRD6_BIN
96
    rc_status -v
97
    ;;
98
  *)
99
    echo "Usage: $0 {start|stop|status|restart|reload}"
100
    exit 1
101
esac
102
rc_exit
103