mirror of
https://github.com/luzifer-docker/personal-dns.git
synced 2024-12-20 20:51:18 +00:00
16 lines
406 B
Bash
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}
|