mirror of
https://github.com/moparisthebest/pi-hole
synced 2024-12-21 22:58:50 -05:00
Merge pull request #122 from dschaper/bug/interfaceCheck
Bug/interface check
This commit is contained in:
commit
f724a3a61a
@ -12,8 +12,8 @@ if [[ -f $piholeIPfile ]];then
|
||||
rm $piholeIPfile
|
||||
else
|
||||
# Otherwise, the IP address can be taken directly from the machine, which will happen when the script is run by the user and not the installation script
|
||||
IPv4dev=$(ip route get 8.8.8.8 | awk '{print $5}')
|
||||
piholeIPCIDR=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}') | awk 'END {print}')
|
||||
IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
|
||||
piholeIPCIDR=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}' | awk 'END {print}')
|
||||
piholeIP=${piholeIPCIDR%/*}
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user