From a9261fa3aac3c9f14709388bd51ad95722ee91e9 Mon Sep 17 00:00:00 2001 From: ChuckNorrison <2964146+ChuckNorrison@users.noreply.github.com> Date: Sat, 5 Sep 2020 22:14:58 +0200 Subject: [PATCH] use 'ip route get' over 'ip addr' for interface check (#1478) use ip route get over ip addr for interface check --- home.admin/00infoBlitz.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index c1f3e434c..8492be95c 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -85,7 +85,7 @@ else fi # get name of active interface (eth0 or wlan0) -network_active_if=$(ip addr | grep -v "lo:" | grep 'state UP' | tr -d " " | cut -d ":" -f2 | head -n 1) +network_active_if=$(ip route get 255.255.255.255 | awk -- '{print $4}' | head -n 1) # get network traffic # ifconfig does not show eth0 on Armbian or in a VM - get first traffic info