From fcf3abd9c42a777804bd1f3512363abc95164f3b Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza <janphilipp@litza.de> Date: Fri, 9 Dec 2016 10:43:24 +0100 Subject: [PATCH] gluon-respondd: restart on state change of client iface Because we unconditionally appended `-i br-client` to the command line of respondd, it wasn't restarted when br-client changed state. Now, we use a jsonfilter expression on the network.interface dump data, similar to how the other interface names are generated, and only add the interface to the argument list if it is up. --- .../files/lib/gluon/respondd/client.dev | 2 +- package/gluon-respondd/files/etc/init.d/gluon-respondd | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/respondd/client.dev b/package/gluon-mesh-batman-adv-core/files/lib/gluon/respondd/client.dev index 30594e2c1..b051c6c57 100644 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/respondd/client.dev +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/respondd/client.dev @@ -1 +1 @@ -br-client +client diff --git a/package/gluon-respondd/files/etc/init.d/gluon-respondd b/package/gluon-respondd/files/etc/init.d/gluon-respondd index 6b61d731a..412f11530 100755 --- a/package/gluon-respondd/files/etc/init.d/gluon-respondd +++ b/package/gluon-respondd/files/etc/init.d/gluon-respondd @@ -7,7 +7,9 @@ DAEMON=/usr/bin/respondd start_service() { DEVS="" - for dev in $( ubus call network.interface dump | jsonfilter -e "@.interface[@.proto='gluon_mesh' && @.up=true].device") $(cat /lib/gluon/respondd/client.dev 2>/dev/null) + for dev in $( ubus call network.interface dump | jsonfilter \ + -e "@.interface[@.proto='gluon_mesh' && @.up=true].device" \ + -e "@.interface[@.interface='$(cat /lib/gluon/respondd/client.dev 2>/dev/null)' && @.up=true].device") do DEVS="$DEVS -i $dev" done -- GitLab