diff options
author | tristan <steckbrief@geekmail.de> | 2019-03-15 11:40:09 +0100 |
---|---|---|
committer | tristan <steckbrief@geekmail.de> | 2019-03-15 11:40:09 +0100 |
commit | ce5c3fd5ff52eb8168b7b998743dd6183ecfc5be (patch) | |
tree | 05de8323781e973f5968bf83a7212e465d0db55e /buildAdBlocklist.sh | |
parent | 3dc24e89b876888cdfac9e3c52d58799fba0e4de (diff) |
adds first implementation of retrieve and build AdBlocklists
Diffstat (limited to 'buildAdBlocklist.sh')
-rwxr-xr-x | buildAdBlocklist.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/buildAdBlocklist.sh b/buildAdBlocklist.sh new file mode 100755 index 0000000..c12d2a6 --- /dev/null +++ b/buildAdBlocklist.sh @@ -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 + |