unbound: skip empty domains at local-data import
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Apr 2020 20:24:42 +0000 (20:24 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 9 Apr 2020 20:24:42 +0000 (20:24 +0000)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/unbound

index 35477ae..acbf6f5 100644 (file)
@@ -78,10 +78,11 @@ write_hosts_conf() {
                while IFS="," read -r enabled address hostname domainname generateptr; do
                        [ "${enabled}" = "on" ] || continue
 
-                       echo "${domainname}"
-               done < /var/ipfire/main/hosts | sort -u | while read -r domainname; do
+                       # Skip empty domainnames
+                       [ "${domainname}" = "" ] && continue
+
                        echo "local-zone: ${domainname} typetransparent"
-               done
+               done < /var/ipfire/main/hosts | sort -u
 
                # Add all hosts
                while IFS="," read -r enabled address hostname domainname generateptr; do