summaryrefslogtreecommitdiff
path: root/network/quagga/rc.quagga
diff options
context:
space:
mode:
authorMarin Glibic <zhilla2@gmail.com>2010-12-29 19:19:03 -0200
committerRobby Workman <rworkman@slackbuilds.org>2010-12-31 18:59:53 -0600
commita5d362da5127036f0608e79a36b1411fcae5b9ac (patch)
treeb08a78a90966306f5a466d8ec0218b1663db2156 /network/quagga/rc.quagga
parentae22224689c79cddd3702167b9e98784d7104704 (diff)
downloadslackbuilds-a5d362da5127036f0608e79a36b1411fcae5b9ac.tar.gz
network/quagga: Added (IP routing daemons)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
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