1
0
mirror of https://github.com/uklans/cache-domains.git synced 2024-05-12 03:54:53 +00:00

Remove duplicates in Unbound generation script

#149 introduced a minor regression which included duplicates for the Unbound generation script.
While this does not have a technical impact it may cause confusion for users, this PR will ignore duplicate entries.
This commit is contained in:
Amir Zarrinkafsh
2021-06-15 13:14:49 +10:00
parent e20cec6475
commit 1cbdc8dbf4

View File

@@ -51,7 +51,7 @@ while read entry; do
continue
fi
parsed=$(echo $fileentry | sed -e "s/^\*\.//")
if grep -qx "$parsed" $outputfile; then
if grep -qx " local-zone: \"${parsed}\" redirect" $outputfile; then
continue
fi
if [[ $(head -n 1 $outputfile) != "server:" ]]; then