aboutsummaryrefslogtreecommitdiffstats
path: root/main/quagga-nhrp/zebra.initd
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-07-03 10:24:54 +0000
committerTimo Teräs <timo.teras@iki.fi>2015-07-03 10:28:18 +0000
commit04c6cba2e48b378679f8316fdd9dd895cede4bc9 (patch)
tree1835844121500be47c932af04ea5961ae7082b14 /main/quagga-nhrp/zebra.initd
parent33c3a706bad78049366a3148bc2ffc950ac24172 (diff)
downloadaports-04c6cba2e48b378679f8316fdd9dd895cede4bc9.tar.bz2
aports-04c6cba2e48b378679f8316fdd9dd895cede4bc9.tar.xz
main/quagga-nhrp: moved from testing
and update patches from main/quagga
Diffstat (limited to 'main/quagga-nhrp/zebra.initd')
-rw-r--r--main/quagga-nhrp/zebra.initd34
1 files changed, 34 insertions, 0 deletions
diff --git a/main/quagga-nhrp/zebra.initd b/main/quagga-nhrp/zebra.initd
new file mode 100644
index 0000000000..6ab297e74f
--- /dev/null
+++ b/main/quagga-nhrp/zebra.initd
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+
+piddir=/var/run/quagga
+pidfile=$piddir/$SVCNAME.pid
+command=/usr/sbin/$SVCNAME
+command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile"
+
+depend() {
+ need net
+ after firewall opennhrp
+}
+
+cleanup() {
+ ebegin "Cleaning up stale zebra routes..."
+ ip route flush proto zebra
+ eend $?
+}
+
+checkconfig() {
+ if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then
+ eerror "You need to create /etc/quagga/$SVCNAME.conf first."
+ eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample"
+ eerror "from quagga-doc package"
+ return 1
+ fi
+ return 0
+}
+
+start_pre() {
+ checkconfig || return 1
+ checkpath --owner quagga:quagga --directory $piddir
+ cleanup
+}
+