From aa72fa032938f07d340d8a9c73524e2393b868c9 Mon Sep 17 00:00:00 2001 From: Denix Date: Sun, 21 Oct 2018 12:22:35 +0200 Subject: [PATCH] more generalized ip address retrieval this change search for the active connection that can be eth0 but also wlan0 (or whatever else if you are using the naming) --- functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index 36e7f2b5..5f918d13 100644 --- a/functions.sh +++ b/functions.sh @@ -3,7 +3,7 @@ # (c) Igor Pecovnik # #get ip -showip=$(ifconfig eth0 | awk -F"[: ]+" '/inet addr:/ {print $4}') +showip=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1') #get architecture if uname -m | grep -i arm > /dev/null; then ARCH=ARM