From 1fd32687e6f08448ae8972d63b974e104620f6d9 Mon Sep 17 00:00:00 2001 From: dwin999 Date: Sun, 25 Jan 2015 01:11:28 +0000 Subject: [PATCH] Update gravity-adv.sh This works much faster. --- gravity-adv.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/gravity-adv.sh b/gravity-adv.sh index 445063d1..8c20c7d2 100755 --- a/gravity-adv.sh +++ b/gravity-adv.sh @@ -29,17 +29,9 @@ echo "Getting someone who cares ad list..." curl -s http://someonewhocares.org/hosts/hosts | grep -v "#" | sed '/^$/d' | sed 's/\ /\\ /g' | awk '{print $2}' >> /tmp/matter.txt # Sort the aggregated results and remove any duplicates -echo "Sorting and removing duplicates..." -cat /tmp/matter.txt | sort | uniq | sed '/^$/d' > /tmp/andLight.txt - -# Read the file, prepend "address=/", and append the IP of the Raspberry Pi -# This creates a correctly-formatted config file -while read fermion -do - boson=$(echo "$fermion" | tr -d '\r') - echo "address=/$boson/$piholeIP" >> $eventHorizion - echo "Added $boson..." -done /"$piholeIP +cat /tmp/matter.txt | sort | uniq | sed '/^$/d' | awk -v "IP=$piholeIP" '{sub(/\r$/,""); print "address=/"$0"/"IP}' > /tmp/andLight.txt +mv /tmp/andLight.txt $eventHorizion # Restart DNS service dnsmasq restart