unbound: add returncode to resolve function

this is used for time fix check.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Arne Fitzenreiter
2020-02-02 13:39:51 +00:00
parent c3ae88cab9
commit f5fe5f47a1

View 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 $?
;;
*)