aboutsummaryrefslogtreecommitdiff
path: root/network/quagga/rc.watchquagga
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.watchquagga
parentae22224689c79cddd3702167b9e98784d7104704 (diff)
network/quagga: Added (IP routing daemons)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/quagga/rc.watchquagga')
-rw-r--r--network/quagga/rc.watchquagga40
1 files changed, 40 insertions, 0 deletions
diff --git a/network/quagga/rc.watchquagga b/network/quagga/rc.watchquagga
new file mode 100644
index 0000000000000..0f9736e2de6c1
--- /dev/null
+++ b/network/quagga/rc.watchquagga
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+start() {
+ if [ -x /usr/sbin/watchquagga ]; then
+
+ for i in zebra bgpd ripd ospfd ripngd ospf6d isisd; do
+ if [ -e /var/run/quagga/$i.pid ] ; then
+ WATCHSERVICES="${WATCHSERVICES} ${i}"
+ fi
+ done
+
+ echo -n "Starting watchquagga: "
+ /usr/sbin/watchquagga -dz -R '/etc/rc.d/rc.quagga restart' $WATCHSERVICES || exit 1
+ echo "done"
+ fi
+}
+
+stop() {
+ echo -n "Stopping watchquagga: "
+ killall watchquagga 2>/dev/null && echo -n "done" || echo -n "not started"
+ echo
+}
+
+restart() {
+ stop && sleep 2s && start
+}
+
+case "$1" in
+ 'start')
+ start
+ ;;
+ 'stop')
+ stop
+ ;;
+ 'restart')
+ restart
+ ;;
+ *)
+ echo "usage $0 start|stop|restart"
+esac