From e29615bc0519957672eb68ece3b0ae40c676ef0b Mon Sep 17 00:00:00 2001 From: Wade Winright <36307531+majestical2018@users.noreply.github.com> Date: Sun, 26 Apr 2020 04:36:43 +1200 Subject: [PATCH] Modified script to handle more types of blocklists (#1771) Added/modified script to better handle multiple types of blocklists available to drop in to the BLOCKLIST_URLS. --- roles/dns/templates/adblock.sh.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/dns/templates/adblock.sh.j2 b/roles/dns/templates/adblock.sh.j2 index cc74f98..cd0be35 100644 --- a/roles/dns/templates/adblock.sh.j2 +++ b/roles/dns/templates/adblock.sh.j2 @@ -14,7 +14,7 @@ rm -f $BLOCKHOSTS echo 'Downloading hosts lists...' #Download and process the files needed to make the lists (enable/add more, if you want) for url in $BLOCKLIST_URLS; do - wget --timeout=2 --tries=3 -qO- "$url" | grep -Ev "(localhost)" | grep -Ew "(0.0.0.0|127.0.0.1)" | awk '{sub(/\r$/,"");print $2}' >> "$TEMP" + wget --timeout=2 --tries=3 -qO- "$url" | grep -Ev "(localhost)" | grep -Ev "#" | sed -E "s/(0.0.0.0 |127.0.0.1 |255.255.255.255 )//" >> "$TEMP" done #Add black list, if non-empty