personal-dns/build_blacklist.sh
Knut Ahlers aa67f4235a
Add local whitelist to unblock entries
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-08-23 15:13:17 +02:00

16 lines
406 B
Bash

#!/bin/bash
set -euo pipefail
target=blacklist
# Download compiled blacklist
curl -sSfL https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | awk '/^(#.*|0.0.0.0.*|)$$/' >${target}
# Remove entries on local whitelist
for entry in $(cat whitelist.local); do
grep -v "${entry}" ${target} >${target}.tmp
mv ${target}.tmp ${target}
done
# Add local blacklist
cat blacklist.local >>${target}