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() {
|
function get_ip_addresses() {
|
||||||
ip -4 -json address | jq -r '
|
ip -4 -json address | jq -r --arg ifregex "${1:-lo}" '
|
||||||
map(select(.ifname != "lo") |
|
map(select(.ifname | test($ifregex) | not) |
|
||||||
.ifname + ":" + (.addr_info | map(.local) | join(","))) |
|
.ifname + ":" + (.addr_info | map(.local) | join(","))) |
|
||||||
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