1
0
mirror of https://github.com/moparisthebest/pi-hole synced 2024-11-26 02:52:17 -05:00

pinholeIP should only use one IP

Updated piholeIP because if there are multiple network adapters, the gravity list will populate incorrectly with both IP addresses. Only one address should be used.
This commit is contained in:
Cole Turner 2015-11-20 22:53:43 -05:00
parent 1578a28363
commit d0e9e90ebe

View File

@ -8,7 +8,7 @@ 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
piholeIP=$(ip -4 addr show | awk '{match($0,/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); ip = substr($0,RSTART,RLENGTH); print ip}' | sed '/^\s*$/d' | grep -v "127.0.0.1")
piholeIP=$(ip -4 addr show | awk '{match($0,/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); ip = substr($0,RSTART,RLENGTH); print ip}' | sed '/^\s*$/d' | grep -v "127.0.0.1" | (head -n1))
fi
# Ad-list sources--one per line in single quotes