#3949 fix vm IPrange (#4736)

* #3949 local ip range detection that also works for VMs
This commit is contained in:
/rootzoll 2024-09-12 18:10:18 +02:00 committed by GitHub
parent e6a8753212
commit 2f2909ccaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -79,7 +79,7 @@ fi
#############################################
# get local IP Range
localiprange=$(ip addr | grep 'state UP' -A2 | grep -E -v 'docker0|veth' | grep 'eth0\|wlan0\|enp0\|inet' | tail -n1 | awk '{print $2}' | awk -F. '{print $1"."$2"."$3".0/24"}')
localiprange=$(ip -o -4 addr show ${networkDevice} | awk '/scope global/ {split($4,ip,"/"); split(ip[1],octets,"."); printf "%s.%s.%s.0/%s\n", octets[1], octets[2], octets[3], ip[2]}')
#############################################
# check DHCP