| 1 |
#!/sbin/runscript
|
| 2 |
# Copyright 1999-2012 Gentoo Foundation
|
| 3 |
# Distributed under the terms of the GNU General Public License v2
|
| 4 |
# $Header: $
|
| 5 |
|
| 6 |
extra_started_commands="reload"
|
| 7 |
|
| 8 |
EXE=bird
|
| 9 |
SOCK="/var/run/${EXE}.ctl"
|
| 10 |
|
| 11 |
depend() {
|
| 12 |
need net
|
| 13 |
use logger
|
| 14 |
}
|
| 15 |
|
| 16 |
checkconfig() {
|
| 17 |
if [ ! -f "/etc/${EXE}.conf" ]; then
|
| 18 |
eerror "Please create /etc/${EXE}.conf"
|
| 19 |
return 1
|
| 20 |
fi
|
| 21 |
return 0
|
| 22 |
}
|
| 23 |
|
| 24 |
start() {
|
| 25 |
checkconfig || return $?
|
| 26 |
ebegin "Starting BIRD"
|
| 27 |
start-stop-daemon --start --exec /usr/sbin/${EXE} -- -c "/etc/${EXE}.conf" -s "${SOCK}"
|
| 28 |
eend $? "Failed to start BIRD"
|
| 29 |
}
|
| 30 |
|
| 31 |
stop() {
|
| 32 |
ebegin "Stopping BIRD"
|
| 33 |
start-stop-daemon --stop --exec /usr/sbin/${EXE}
|
| 34 |
eend $? "Failed to stop BIRD"
|
| 35 |
}
|
| 36 |
|
| 37 |
reload() {
|
| 38 |
ebegin "Reloading BIRD"
|
| 39 |
start-stop-daemon --stop --signal HUP --oknodo --exec /usr/sbin/${EXE}
|
| 40 |
eend $? "Failed to reload BIRD"
|
| 41 |
}
|