netstatus: Re-enable filtering interfaces by regex from script argument
This commit is contained in:
parent
cce8cf0917
commit
55c60257c1
@ -9,11 +9,11 @@ function doPing () {
|
||||
}
|
||||
|
||||
function get_ip_addresses() {
|
||||
ip -4 -json address | jq -r '
|
||||
map(select(.ifname != "lo") |
|
||||
ip -4 -json address | jq -r --arg ifregex "${1:-lo}" '
|
||||
map(select(.ifname | test($ifregex) | not) |
|
||||
.ifname + ":" + (.addr_info | map(.local) | join(","))) |
|
||||
join(" ")
|
||||
'
|
||||
}
|
||||
|
||||
echo -n "<txt>$(get_ip_addresses) $(doPing 8.8.8.8 G)</txt>"
|
||||
echo -n "<txt>$(get_ip_addresses "$1") $(doPing 8.8.8.8 G)</txt>"
|
||||
|
Loading…
Reference in New Issue
Block a user