[2/2] fff-babel: add nodewatcher data

Submitted by Tim Niemeyer on Sept. 8, 2019, 3:18 p.m.

Details

Message ID 20190908151852.25677-2-tim@tn-x.org
State New
Headers show

Commit Message

Tim Niemeyer Sept. 8, 2019, 3:18 p.m.
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
---

 .../files/usr/lib/nodewatcher.d/40-babel.sh       | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100755 src/packages/fff/fff-babeld/files/usr/lib/nodewatcher.d/40-babel.sh

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-babeld/files/usr/lib/nodewatcher.d/40-babel.sh b/src/packages/fff/fff-babeld/files/usr/lib/nodewatcher.d/40-babel.sh
new file mode 100755
index 0000000..6155d8f
--- /dev/null
+++ b/src/packages/fff/fff-babeld/files/usr/lib/nodewatcher.d/40-babel.sh
@@ -0,0 +1,15 @@ 
+#!/bin/sh
+# Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
+# License; GPL v3
+
+debug() {
+    (>&2 echo "$1")
+}
+
+debug "$(date): Collecting information from babeld"
+
+BABELS=$(echo dump | nc ::1 33123 | awk '/^add neighbour/ {print "<neighbour>"$5"<outgoing_interface>"$7"</outgoing_interface></neighbour>"}')
+
+echo "<babel_neighbours>$BABELS</babel_neighbours>"
+
+exit 0