From 2bb44bfc95ae29b828fada5e394e94f595d0adb5 Mon Sep 17 00:00:00 2001 From: arno Date: Wed, 22 Jul 2020 16:56:10 +0200 Subject: [PATCH 1/3] detect more network interface names --- home.admin/_bootstrap.sh | 2 +- home.admin/config.scripts/blitz.statusscan.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 4b5165564..e7b3b0f50 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -239,7 +239,7 @@ fi gotLocalIP=0 until [ ${gotLocalIP} -eq 1 ] do - localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | grep 'eth0\|wlan0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') + localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | egrep -i '(eth|ens|enp|eno|wlan|wlp)' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') if [ ${#localip} -eq 0 ]; then # display user to connect LAN sed -i "s/^state=.*/state=noIP/g" ${infoFile} diff --git a/home.admin/config.scripts/blitz.statusscan.sh b/home.admin/config.scripts/blitz.statusscan.sh index 02bc55d97..c04ff53e4 100644 --- a/home.admin/config.scripts/blitz.statusscan.sh +++ b/home.admin/config.scripts/blitz.statusscan.sh @@ -17,7 +17,7 @@ sudo mkdir /mnt/hdd/temp 2>/dev/null sudo chmod 777 -R /mnt/hdd/temp 2>/dev/null # localIP -localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | grep 'eth0\|wlan0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') +localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | egrep -i '(eth|ens|enp|eno|wlan|wlp)' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') echo "localIP='${localip}'" # temp - no measurement in a VM @@ -267,4 +267,4 @@ fi # info on scan run time endTime=$(date +%s) runTime=$(echo "${endTime}-${startTime}" | bc) -echo "scriptRuntime=${runTime}" \ No newline at end of file +echo "scriptRuntime=${runTime}" From 47e43a0276b6d2a3bdba8af7ff55f45a4d7e193d Mon Sep 17 00:00:00 2001 From: arno Date: Wed, 22 Jul 2020 18:33:38 +0200 Subject: [PATCH 2/3] updated regular expression --- home.admin/_bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index e7b3b0f50..a50fc284e 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -239,7 +239,7 @@ fi gotLocalIP=0 until [ ${gotLocalIP} -eq 1 ] do - localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | egrep -i '(eth|ens|enp|eno|wlan|wlp)' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') + localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | egrep -i '(*[eth|ens|enp|eno|wlan|wlp][0-9]$)' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') if [ ${#localip} -eq 0 ]; then # display user to connect LAN sed -i "s/^state=.*/state=noIP/g" ${infoFile} From c6e56dbadf236842b2f05a4e40ac1bb2423d98e2 Mon Sep 17 00:00:00 2001 From: arno Date: Wed, 22 Jul 2020 18:35:12 +0200 Subject: [PATCH 3/3] updated regular expression --- home.admin/config.scripts/blitz.statusscan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/blitz.statusscan.sh b/home.admin/config.scripts/blitz.statusscan.sh index c04ff53e4..a5e2cdf48 100644 --- a/home.admin/config.scripts/blitz.statusscan.sh +++ b/home.admin/config.scripts/blitz.statusscan.sh @@ -17,7 +17,7 @@ sudo mkdir /mnt/hdd/temp 2>/dev/null sudo chmod 777 -R /mnt/hdd/temp 2>/dev/null # localIP -localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | egrep -i '(eth|ens|enp|eno|wlan|wlp)' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') +localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | egrep -i '(*[eth|ens|enp|eno|wlan|wlp][0-9]$)' | tail -n1 | awk '{print $2}' | cut -f1 -d'/') echo "localIP='${localip}'" # temp - no measurement in a VM