update-list: Unify var-usage as ${VAR}; Only write unique-zones

This commit is contained in:
Enno Tensing 2024-12-30 18:12:16 +01:00
parent 8cb50fd264
commit d5bc929061
Signed by: tenno
GPG key ID: 95265603BD36E66C

View file

@ -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