]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
unbound: add returncode to resolve function
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 2 Feb 2020 13:39:51 +0000 (13:39 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 2 Feb 2020 13:40:32 +0000 (13:40 +0000)
this is used for time fix check.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/unbound

index 3322c15b5fe0cdeda42d009a64c1c39eb6df55b5..78be8e2d50505ad4f2cd0d2ffb4b668155acad80 100644 (file)
@@ -286,14 +286,18 @@ fix_time_if_dns_fails() {
 
 resolve() {
        local hostname="${1}"
+       local found=1
 
        local answer
        for answer in $(dig +short A "${hostname}"); do
                # Filter out non-IP addresses
                if [[ ! "${answer}" =~ \.$ ]]; then
+                       found=0
                        echo "${answer}"
                fi
        done
+
+       return ${found}
 }
 
 # Sets up Safe Search for various search engines
@@ -607,7 +611,7 @@ case "$1" in
                ;;
 
        resolve)
-               resolve "${2}"
+               resolve "${2}" || exit $?
                ;;
 
        *)