From 824f129124ec06ea0878dc0fdb43e39e14628250 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 15 Feb 2022 06:59:01 +0100 Subject: [PATCH] Fix missing condition. --- scripts/create-unbound.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/create-unbound.sh b/scripts/create-unbound.sh index 1075684..c70a251 100755 --- a/scripts/create-unbound.sh +++ b/scripts/create-unbound.sh @@ -50,14 +50,16 @@ while read entry; do destfilename=$(echo $filename | sed -e 's/txt/conf/') outputfile=${outputdir}/${destfilename} touch $outputfile - - echo 'forward-zone:' > $outputfile - echo " name: \"${key}.cache.lancache.net.\"" >> $outputfile - for i in ${cacheip}; do - echo " forward-addr: \"${i}\"" >> $outputfile - done - echo " forward-first: yes" >> $outputfile - echo " forward-no-cache: yes" >> $outputfile + + if $forward; then + echo 'forward-zone:' > $outputfile + echo " name: \"${key}.cache.lancache.net.\"" >> $outputfile + for i in ${cacheip}; do + echo " forward-addr: \"${i}\"" >> $outputfile + done + echo " forward-first: yes" >> $outputfile + echo " forward-no-cache: yes" >> $outputfile + fi while read fileentry; do # Ignore comments and newlines