summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/bird/files/initd-v4-bird-1.2.3')
-rw-r--r--net-misc/bird/files/initd-v4-bird-1.2.339
1 files changed, 39 insertions, 0 deletions
diff --git a/net-misc/bird/files/initd-v4-bird-1.2.3 b/net-misc/bird/files/initd-v4-bird-1.2.3
new file mode 100644
index 000000000000..8d2014f3f40a
--- /dev/null
+++ b/net-misc/bird/files/initd-v4-bird-1.2.3
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EXE=bird
+CLI=birdc
+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"
+ "/usr/sbin/${EXE}" -c "/etc/${EXE}.conf" -s "${SOCK}"
+ eend $? "Failed to start BIRD"
+}
+
+stop() {
+ ebegin "Stopping BIRD"
+ if [ -f "${SOCK}" ]; then
+ echo "down" | "/usr/sbin/${CLI}" -s "${SOCK}" &>/dev/null
+ eend $? "Failed to stop BIRD"
+ else
+ eend 0
+ fi
+}