diff --git a/scripts/create-dnsmasq.sh b/scripts/create-dnsmasq.sh index 756cf2a..46483ac 100755 --- a/scripts/create-dnsmasq.sh +++ b/scripts/create-dnsmasq.sh @@ -52,10 +52,12 @@ while read -r entry; do fi parsed=$(echo ${fileentry} | sed -e "s/^\*\.//") for i in ${cacheip}; do - if grep -qx "address=/${parsed}/${i}" "${outputfile}"; then - continue + if ! grep -qx "address=/${parsed}/${i}" "${outputfile}"; then + echo "address=/${parsed}/${i}" >> "${outputfile}" + fi + if ! grep -qx "local=/${parsed}/" "${outputfile}"; then + echo "local=/${parsed}/" >> "${outputfile}" fi - echo "address=/${parsed}/${i}" >> "${outputfile}" done done <<< $(cat ${basedir}/${filename} | sort); done <<< $(jq -r ".cache_domains[${entry}].domain_files[$fileid]" ${path})