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

Merge pull request #82 from colepatrickturner/master

pinholeIP should only use one IP
This commit is contained in:
Jacob Salmela 2015-11-21 12:56:25 -06:00
commit a3a244c4af

View File

@ -8,7 +8,7 @@ if [[ -f $piholeIPfile ]];then
rm $piholeIPfile rm $piholeIPfile
else 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 # 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 fi
# Ad-list sources--one per line in single quotes # Ad-list sources--one per line in single quotes