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