wireguard-tools: avoid redundant jsonfilter calls
Use a single jsonfilter expression to yield the list of logical wireguard interface names in shell compatible notation. Supersedes: #12344 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user