From d5bc9290613502f586fc51dbbbb91ca82e4e0ba1 Mon Sep 17 00:00:00 2001 From: Enno Tensing Date: Mon, 30 Dec 2024 18:12:16 +0100 Subject: [PATCH] update-list: Unify var-usage as ${VAR}; Only write unique-zones --- update-list.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/update-list.sh b/update-list.sh index 6bbfd4a..a37460a 100755 --- a/update-list.sh +++ b/update-list.sh @@ -18,7 +18,7 @@ update_sources() mkdir -p "/tmp/${BUILDDIR}" && cd "/tmp/${BUILDDIR}" || exit 1 cat "${SOURCES}" | while read -r src do - curl -#LO "$src" + curl -#LO "${src}" done find . -type f | while read -r file do @@ -30,13 +30,13 @@ 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')" + blocktype="$(printf '%b' "${TYPE}" | sed -e 's|-|_|g')" do - if ! [ -z "$domain" ] + if ! [ -z "${domain}" ] then - printf 'local-zone: "%b" %b\n' "$domain" "$blocktype" + printf 'local-zone: "%b" %b\n' "${domain}" "${blocktype}" fi - done | tee "${CONF}" + done | uniq | tee "${CONF}" } trap cleanup QUIT INT TERM EXIT