summaryrefslogtreecommitdiff
path: root/network/quagga/rc.quagga
diff options
context:
space:
mode:
Diffstat (limited to 'network/quagga/rc.quagga')
-rw-r--r--network/quagga/rc.quagga43
1 files changed, 43 insertions, 0 deletions
diff --git a/network/quagga/rc.quagga b/network/quagga/rc.quagga
new file mode 100644
index 0000000000..3033da277c
--- /dev/null
+++ b/network/quagga/rc.quagga
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# rc.quagga will try to start any service that has configured a config file in /etc/quagga
+
+start() {
+
+ for SERVICE in zebra bgpd ripd ospfd ripngd ospf6d isisd; do
+ if [ -r /etc/quagga/$SERVICE.conf ] ; then
+ echo -n "Starting ${SERVICE}: " && /usr/sbin/${SERVICE} -d && echo "done"
+ fi
+ done
+}
+
+stop() {
+
+ for SERVICE in zebra bgpd ripd ospfd ripngd ospf6d isisd; do
+ echo -n "Stopping ${SERVICE}: "
+ killall $SERVICE 2>/dev/null && echo -n "done" || echo -n "not started"
+ echo
+ done
+}
+
+restart() {
+
+ stop && sleep 2s && start
+ if [ -x /etc/rc.d/rc.watchquagga ] ; then
+ sh /etc/rc.d/rc.watchquagga restart
+ fi
+}
+
+case "$1" in
+ 'start')
+ start
+ ;;
+ 'stop')
+ stop
+ ;;
+ 'restart')
+ restart
+ ;;
+ *)
+ echo "usage $0 start|stop|restart"
+esac