commit 7012ff6e926bab5aaa254a65004ce632bda75d93 Author: Enno Tensing Date: Thu Dec 26 11:58:21 2024 +0100 meta: Initial commit diff --git a/sources b/sources new file mode 100644 index 0000000..afc243d --- /dev/null +++ b/sources @@ -0,0 +1,6 @@ +https://v.firebog.net/hosts/static/w3kbl.txt +https://v.firebog.net/hosts/Easyprivacy.txt +https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt +https://v.firebog.net/hosts/Prigent-Ads.txt +https://raw.githubusercontent.com/d3ward/toolz/refs/heads/master/src/d3host.txt +https://raw.githubusercontent.com/RPiList/specials/refs/heads/master/Blocklisten/easylist diff --git a/update-list.sh b/update-list.sh new file mode 100755 index 0000000..f6b1600 --- /dev/null +++ b/update-list.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +CONFDIR="/etc/unbound" +CONFFILE="always-deny.conf" +CONF="${CONFDIR}/${CONFFILE}" +SOURCES="${CONFDIR}/sources" +BUILDDIR="/tmp/$(openssl rand -hex 42)" + +update_sources() +{ + mkdir -p "${BUILDDIR}" && cd "${BUILDDIR}" || exit 1 + cat "${SOURCES}" | while read -r src + do + curl -#LO "$src" + done + find . -type f | while read -r file + do + cat "$file" | tee -a domains + done +} + +format_sources() +{ + cat domains | tr -d '|' | tr -d '^' | grep -v '#' | sed -e 's|0.0.0.0 ||g' | sort -u | uniq > new_domains + cat new_domains | while read -r domain + do + if ! [ -z "$domain" ] + then + printf 'local-zone: "%b" always_deny\n' "$domain" + fi + done | tee "${CONF}" +} + +update_sources +format_sources