mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Remove leading and trailing whitespace and .
characters and
duplicate `.` characters as each list is stored. Should fix #32.
This commit is contained in:
parent
d6d192cb0a
commit
1f29d01694
1 changed files with 2 additions and 1 deletions
|
@ -69,7 +69,8 @@ do
|
||||||
# Most of the lists downloaded are already in hosts file format but the spacing/formating is not contigious
|
# Most of the lists downloaded are already in hosts file format but the spacing/formating is not contigious
|
||||||
# This helps with that and makes it easier to read
|
# This helps with that and makes it easier to read
|
||||||
# It also helps with debugging so each stage of the script can be researched more in depth
|
# It also helps with debugging so each stage of the script can be researched more in depth
|
||||||
echo "$data" | awk 'NF {if ($1 !~ "#") { if (NF>1) {print $2} else {print $1}}}' > $saveLocation
|
echo "$data" | awk 'NF {if ($1 !~ "#") { if (NF>1) {print $2} else {print $1}}}' | \
|
||||||
|
sed -e 's/^[. \t]*//' -e 's/\.\.\+/./g' -e 's/[. \t]*$//' > $saveLocation
|
||||||
else
|
else
|
||||||
echo "Skipping $domain list because it does not have any new entries..."
|
echo "Skipping $domain list because it does not have any new entries..."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue