]> git.pld-linux.org Git - packages/bird.git/blame - bird.init
- allow some actions when network is down
[packages/bird.git] / bird.init
CommitLineData
e43bf22c
AM
1#!/bin/sh
2#
3# bird Starts the Dynamic Route Daemon
4#
5# chkconfig: 345 80 45
6#
7# description: Dynamic Route Daemon for IPv4 and IPv6 routers
8#
9# processname: bird
10# config: /etc/bird.conf
11
12
13# Source function library
14. /etc/rc.d/init.d/functions
15
16# Get network config
17. /etc/sysconfig/network
18
19# Get service config
20[ -f /etc/sysconfig/bird ] && . /etc/sysconfig/zebra
21
22# Check that networking is up.
d0ed0b41 23if is_yes "${NETWORKING}"; then
f5288987 24 if [ ! -f /var/lock/subsys/network -a != stop -a != status ]; then
d0ed0b41 25 msg_network_down bird
26 exit 1
27 fi
28else
29 exit 0
e43bf22c
AM
30fi
31
32# Sanity checks.
33[ -f /etc/bird.conf ] || exit 0
34
8884530a 35RETVAL=0
e43bf22c
AM
36# See how we were called.
37case "$1" in
38 start)
39 # Check if the services are already running?
40 if [ ! -f /var/lock/subsys/bird ]; then
41 msg_starting "bird"
1f4bc5c9 42 daemon ${SERVICE_RUN_NICE_LEVEL} bird
8884530a 43 RETVAL=$?
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bird
e43bf22c 45 else
e760f90b 46 msg_already_running "bird"
e43bf22c
AM
47 fi
48 ;;
49 stop)
e760f90b 50 # Stop daemons.
e43bf22c
AM
51 if [ -f /var/lock/subsys/bird ]; then
52 msg_stopping "bird"
53 killproc bird
54 rm -f /var/lock/subsys/bird
55 else
e760f90b 56 msg_not_running "bird"
e43bf22c
AM
57 fi
58 ;;
59 status)
60 status bird
8884530a 61 exit $?
e43bf22c 62 ;;
8884530a 63 restart|force-reload)
e43bf22c
AM
64 $0 stop
65 $0 start
8884530a 66 exit $?
e43bf22c
AM
67 ;;
68 *)
8884530a 69 msg_usage "$0 {start|stop|restart|force-reload|status}"
70 exit 3
e43bf22c
AM
71esac
72
8884530a 73exit $RETVAL
This page took 0.031763 seconds and 4 git commands to generate.