42 lines
938 B
Text
42 lines
938 B
Text
#!/sbin/runscript
|
|
# Copyright 1999-2011 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: /var/cvsroot/gentoo-x86/net-misc/bird/files/initd-v4-bird-1.3.0,v 1.1 2011/03/31 09:48:53 chainsaw Exp $
|
|
|
|
opts="reload"
|
|
|
|
EXE=bird
|
|
SOCK="/var/run/${EXE}.ctl"
|
|
|
|
depend() {
|
|
need net
|
|
use logger
|
|
}
|
|
|
|
checkconfig() {
|
|
if [ ! -f "/etc/${EXE}.conf" ]; then
|
|
eerror "Please create /etc/${EXE}.conf"
|
|
return 1
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
start() {
|
|
checkconfig || return $?
|
|
ebegin "Starting BIRD"
|
|
start-stop-daemon --start --exec /usr/sbin/${EXE} -- -c "/etc/${EXE}.conf" -s "${SOCK}"
|
|
eend $? "Failed to start BIRD"
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping BIRD"
|
|
start-stop-daemon --stop --exec /usr/sbin/${EXE}
|
|
eend $? "Failed to stop BIRD"
|
|
}
|
|
|
|
reload() {
|
|
service_started "${SVCNAME}" || return
|
|
ebegin "Reloading BIRD"
|
|
start-stop-daemon --stop --signal HUP --oknodo --exec /usr/sbin/${EXE}
|
|
eend $? "Failed to reload BIRD"
|
|
}
|