From 258f0b412706ab3c2a74f1bff7721b9153c98ee4 Mon Sep 17 00:00:00 2001 From: CHannema Date: Wed, 12 Aug 2015 18:05:46 +0200 Subject: [PATCH] fixes corrupt lines that have two dots some of the downloaded files have domains entries like 'ads..com'. These are invalid and should be removed. --- gravity.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gravity.sh b/gravity.sh index f1e70a63..718e793d 100755 --- a/gravity.sh +++ b/gravity.sh @@ -101,6 +101,9 @@ function gravity_advanced() # 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 + # remove corrupt lines (like ..com) + echo "** Deleting invalid entries..." + sed -i '/\.\./d' $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)