From 6304a317e40722a52fd4e836e63f8eb94d9a6c0c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 15 Apr 2018 12:49:52 +0200 Subject: [PATCH] gluon-l3roamd: fix interface checks in initscript The local_node ifstatus must be checked for local-node, not client. While we're at it, also clean up the syntax a bit. --- package/gluon-l3roamd/files/etc/init.d/gluon-l3roamd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package/gluon-l3roamd/files/etc/init.d/gluon-l3roamd b/package/gluon-l3roamd/files/etc/init.d/gluon-l3roamd index 9fe597b9..d40e1a18 100755 --- a/package/gluon-l3roamd/files/etc/init.d/gluon-l3roamd +++ b/package/gluon-l3roamd/files/etc/init.d/gluon-l3roamd @@ -6,12 +6,15 @@ USE_PROCD=1 PROG=/usr/sbin/l3roamd start_service () { + local interfaces=$( + for dev in $(gluon-list-mesh-interfaces); do echo " -m $dev"; done + [ "$(ifstatus local_node | jsonfilter -e '@.up')" = 'true' ] && echo ' -i local-node' + ) + procd_open_instance procd_set_param stdout 1 procd_set_param stderr 1 procd_set_param respawn ${respawn_threshold:-3660} ${respawn_timeout:-5} ${respawn_retry:-0} - interfaces=$(for dev in $(gluon-list-mesh-interfaces);do echo " -m $dev"; done; - [ "$(ifstatus client | jsonfilter -e "@.up")" = "true" ] && echo " -i local-node") procd_set_param command "$PROG" -s /var/run/l3roamd.sock -p $(lua -e 'print(require("gluon.site").prefix6())') $interfaces -t 254 -a $(uci get network.loopback.ip6addr | cut -d/ -f1) -4 0:0:0:0:0:ffff::/96 -b br-client procd_close_instance } @@ -21,6 +24,6 @@ service_triggers() { local name=$(basename "${script:-$initscript}") procd_open_trigger - procd_add_raw_trigger "interface.*" 0 "/etc/init.d/$name" reload + procd_add_raw_trigger 'interface.*' 0 "/etc/init.d/$name" reload procd_close_trigger }