mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-30 18:13:18 +00:00
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.
This commit is contained in:
parent
77a3c5f8b3
commit
258f0b4127
1 changed files with 3 additions and 0 deletions
|
@ -101,6 +101,9 @@ function gravity_advanced()
|
||||||
# Format domain list as "192.168.x.x domain.com"
|
# Format domain list as "192.168.x.x domain.com"
|
||||||
echo "** Formatting domains into a HOSTS file..."
|
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
|
||||||
|
# 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
|
# Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it
|
||||||
sudo cp $origin/$accretionDisc $adList
|
sudo cp $origin/$accretionDisc $adList
|
||||||
kill -HUP $(pidof dnsmasq)
|
kill -HUP $(pidof dnsmasq)
|
||||||
|
|
Loading…
Reference in a new issue