mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 05:38:00 +00:00
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:
parent
33f15dd6d4
commit
039f8a1241
@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
PKG_NAME:=wireguard-tools
|
PKG_NAME:=wireguard-tools
|
||||||
|
|
||||||
PKG_VERSION:=1.0.20210914
|
PKG_VERSION:=1.0.20210914
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/
|
PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/
|
||||||
|
@ -59,7 +59,7 @@ check_peer_activity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# query ubus for all active wireguard interfaces
|
# 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
|
# check every peer in every active wireguard interface
|
||||||
config_load network
|
config_load network
|
||||||
|
Loading…
Reference in New Issue
Block a user