mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 12:06:36 +02:00
detect more network interface names
This commit is contained in:
@@ -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}
|
||||
|
@@ -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}"
|
||||
echo "scriptRuntime=${runTime}"
|
||||
|
Reference in New Issue
Block a user