mirror of
https://github.com/moparisthebest/pi-hole
synced 2024-11-25 18:42:16 -05:00
Update gravity-adv.sh
This works much faster.
This commit is contained in:
parent
55ebc0e492
commit
1fd32687e6
@ -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
|
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
|
# Sort the aggregated results and remove any duplicates
|
||||||
echo "Sorting and removing duplicates..."
|
echo "removing duplicates and formatting to address=/<ad domain>/"$piholeIP
|
||||||
cat /tmp/matter.txt | sort | uniq | sed '/^$/d' > /tmp/andLight.txt
|
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
|
||||||
# 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 </tmp/andLight.txt
|
|
||||||
|
|
||||||
# Restart DNS
|
# Restart DNS
|
||||||
service dnsmasq restart
|
service dnsmasq restart
|
||||||
|
Loading…
Reference in New Issue
Block a user