diff --git a/update-list.sh b/update-list.sh index 40b929d..6bbfd4a 100755 --- a/update-list.sh +++ b/update-list.sh @@ -1,7 +1,8 @@ #!/bin/sh +TYPE="always-null" CONFDIR="/etc/unbound" -CONFFILE="always-deny.conf" +CONFFILE="${TYPE}.conf" CONF="${CONFDIR}/${CONFFILE}" SOURCES="${CONFDIR}/sources" BUILDDIR="$(openssl rand -hex 42)" @@ -29,10 +30,11 @@ 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 + blocktype="$(printf '%b' "$TYPE" | sed -e 's|-|_|g')" do if ! [ -z "$domain" ] then - printf 'local-zone: "%b" always_deny\n' "$domain" + printf 'local-zone: "%b" %b\n' "$domain" "$blocktype" fi done | tee "${CONF}" }