From 55c60257c179501a702a94904130800e6de0eb66 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 4 Oct 2022 13:03:01 -0400 Subject: [PATCH] netstatus: Re-enable filtering interfaces by regex from script argument --- .config/xfce4/panel/scripts/netstatus.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/xfce4/panel/scripts/netstatus.sh b/.config/xfce4/panel/scripts/netstatus.sh index 8ef7cd0..e0c2f49 100755 --- a/.config/xfce4/panel/scripts/netstatus.sh +++ b/.config/xfce4/panel/scripts/netstatus.sh @@ -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 "$(get_ip_addresses) $(doPing 8.8.8.8 G)" +echo -n "$(get_ip_addresses "$1") $(doPing 8.8.8.8 G)"