Fixed incorrect passing of duplicates

This commit is contained in:
VibroAxe 2018-11-29 10:36:11 +00:00
parent 00619cf6d2
commit 0a980bd03c

View file

@ -17,13 +17,9 @@ echo " default \$http_host;" >> $outputfile
key=$(jq -r ".cache_domains[$entry].name" cache_domains.json)
jq -r ".cache_domains[$entry].domain_files | to_entries[] | .key" cache_domains.json | while read fileid; do
jq -r ".cache_domains[$entry].domain_files[$fileid]" cache_domains.json | while read filename; do
echo "" >> $outputfile
cat ${filename} | while read fileentry; do
# Ignore comments
case "$var" in
\#*) continue ;;
esac
if grep -q "$fileentry" $outputfile; then
echo $fileentry
if grep -q "^$fileentry" $outputfile; then
continue
fi
echo " ${fileentry} ${key};" >> $outputfile