feat: add dnsmasq-compatible blocklist

- Inspired by https://github.com/tanrax/maza-ad-blocking
This commit is contained in:
curben 2020-03-30 03:48:01 +01:00
parent bed7755dac
commit 22672a17ac
1 changed files with 12 additions and 0 deletions

View File

@ -122,4 +122,16 @@ sort | \
sed '1 i\'"$COMMENT"'' | \
sed "1s/Malicious/Online Malicious/" > "../urlhaus-filter-hosts-online.txt"
## Dnsmasq-compatible blocklist
cat "../urlhaus-filter-hosts.txt" | \
# Remove IPv4 address
grep -vE "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | \
sed "6~1s/^/address=\//g" | \
sed "6~1s/$/\/127.0.0.1/g" > "../urlhaus-filter-dnsmasq.conf"
cat "../urlhaus-filter-hosts-online.txt" | \
grep -vE "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | \
sed "6~1s/^/address=\//g" | \
sed "6~1s/$/\/127.0.0.1/g" > "../urlhaus-filter-dnsmasq-online.conf"
cd ../ && rm -rf "tmp/"