From 6976532ef5b52f3b0c769e35b3071c5decdbb9aa Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Tue, 6 Oct 2015 06:12:52 -0500 Subject: [PATCH] Removing IP as input Due to users having issues with the IP not being entered properly, I am restoring the original way to store `piholeIP` until a better solution can be formed. --- gravity.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gravity.sh b/gravity.sh index d548d13e..1f5e3fb6 100755 --- a/gravity.sh +++ b/gravity.sh @@ -3,12 +3,7 @@ # Compiles a list of ad-serving domains by downloading them from multiple sources # This script should only be run after you have a static IP address set on the Pi -piholeIP="$1" - -if [[ -n "$piholeIP" ]]; then - piholeIP=$(hostname -I|xargs) -fi - +piholeIP=$(hostname -I) # Ad-list sources--one per line in single quotes sources=('https://adaway.org/hosts.txt' @@ -141,7 +136,7 @@ function gravity_advanced() echo "** $numberOf unique domains trapped in the event horizon." # Format domain list as "192.168.x.x domain.com" echo "** Formatting domains into a HOSTS file..." - cat $origin/$eventHorizon | awk '{sub(/\r$/,""); print "'"$piholeIP "'" $0}' > $origin/$accretionDisc + cat $origin/$eventHorizon | awk '{sub(/\r$/,""); print "'"$piholeIP"'" $0}' > $origin/$accretionDisc # Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it sudo cp $origin/$accretionDisc $adList kill -HUP $(pidof dnsmasq)