adds first implementation of retrieve and build AdBlocklists

This commit is contained in:
tristan 2019-03-15 11:40:09 +01:00
parent 3dc24e89b8
commit ce5c3fd5ff
4 changed files with 18 additions and 0 deletions

7
adfilelist.txt Normal file
View file

@ -0,0 +1,7 @@
StevenBlack|https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
MalwareDomains|https://mirror1.malwaredomains.com/files/justdomains
SysCtl|http://sysctl.org/cameleon/hosts
Zeus|https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
DisconnectSimple|https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
DisconnectAd|https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
HostsFile|https://hosts-file.net/ad_servers.txt

1
adlists/README Normal file
View file

@ -0,0 +1 @@
This directory is for the downloaded source ad block lists

6
buildAdBlocklist.sh Executable file
View file

@ -0,0 +1,6 @@
#°/bin/bash
ADLISTDIR=adlists
for adfile in $(ls $ADLISTDIR); do
grep -v '^#' < $ADLISTDIR/$adfile | grep -v '^$' | awk '{if (0 < match($0, "\t") || 0 < index($0, " ")) {split($0,b," "); print b[2]} else print $0}' | grep -v '^localhost$' | grep -v '^local$' | grep -v '^localhost.localdomain$' | grep -v '^ip6-localnet$' | grep -v '^ip6-localhost$' >> block.list
done

4
retrieveAdBlocklists.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
while read p; do
echo "$p" | awk '{split($0,a,"|"); system("wget -O adlists/"a[1] " " a[2])}'
done < adfilelist.txt