mirror of
https://github.com/moparisthebest/pi-hole
synced 2024-12-22 07:08:49 -05:00
Get last IP listed for interface
This commit is contained in:
parent
f7f2895eec
commit
d8034f4156
@ -13,7 +13,7 @@ if [[ -f $piholeIPfile ]];then
|
||||
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}')
|
||||
piholeIPCIDR=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}') | sed -n '$p'
|
||||
piholeIP=${piholeIPCIDR%/*}
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user