RetrieveAdBlocklists/buildAdBlocklist.sh

14 lines
311 B
Bash
Raw Normal View History

2019-03-16 13:20:01 +01:00
#!/bin/bash
awk -F'[\t ]+' '{
if (!match($0, /^\s*(#|$)/)) {
if (NF>=2 && length($2)) {
host=$2
} else {
host=$1
}
if (!match(host, /^(localhost|local|localhost.localdomain|ip6-localnet|ip6-localhost$)$/)) {
print "127.0.0.1 " host
}
}
}' adlists/* | sort > block.list