mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-11 13:20:56 +02:00
#3949 local ip range detection that also works for VMs
This commit is contained in:
parent
e6a8753212
commit
68e6d54a22
@ -79,7 +79,8 @@ 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 | awk '/scope global/ {last=$4} END {split(last, ip, "/"); split(ip[1], octets, "."); printf "%s.%s.%s.0/%s\n", octets[1], octets[2], octets[3], ip[2]}'
|
||||
)
|
||||
|
||||
#############################################
|
||||
# check DHCP
|
||||
|
Loading…
x
Reference in New Issue
Block a user