wireguard-tools: avoid redundant jsonfilter calls
[openwrt/staging/blocktrron.git] / package / network / utils / wireguard-tools / files / wireguard_watchdog
index 0126f699bb433e75bdc2ebb62b8a27a56769ba01..fc90f4a25b3564fb7a4cd3b464266d374c32f374 100644 (file)
@@ -59,7 +59,7 @@ check_peer_activity() {
 }
 
 # query ubus for all active wireguard interfaces
-wg_ifaces=$(ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " ")
+eval $(ubus -S call network.interface dump | jsonfilter -e 'wg_ifaces=@.interface[@.up=true && @.proto="wireguard"].interface')
 
 # check every peer in every active wireguard interface
 config_load network