mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
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:
@@ -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 $?
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user