IP detection only relies on duckduck.go

This commit is contained in:
Quentin McGaw
2018-05-27 20:38:43 -04:00
parent ec9b989ea7
commit bcc39a97f0
2 changed files with 7 additions and 9 deletions

View File

@@ -1,9 +1,8 @@
#!/bin/sh
printf "\nDetecting details from public IP address..."
export CITY=$(wget -qO- -T 2 https://ipinfo.io/city)
export ORG=$(wget -qO- -T 2 https://ipinfo.io/org)
printf "DONE\nOrganization: $ORG\nCity: $CITY\nChanging DNS to localhost..."
printf "\nGetting public IP address..."
export INITIAL_IP=$(wget -qqO- 'https://duckduckgo.com/?q=what+is+my+ip' | grep -ow 'Your IP address is [0-9.]*[0-9]' | grep -ow '[0-9][0-9.]*')
printf "DONE\nChanging DNS to localhost..."
echo "nameserver 127.0.0.1" > /etc/resolv.conf
echo "options ndots:0" >> /etc/resolv.conf
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint..."