From 535cc44eaad24c4143c3e7eb01836887d0676d3a Mon Sep 17 00:00:00 2001 From: Cielquan <> Date: Tue, 6 Aug 2019 22:24:41 +0200 Subject: [PATCH] fixed root.hints downloader --- setup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index d47a9f0..4368bf0 100755 --- a/setup.sh +++ b/setup.sh @@ -307,16 +307,15 @@ fi # Download root.hints file -echo "" if ! [ -f unbound-docker/var/root.hints ]; then - if wget -nv https://www.internic.net/domain/named.root -O unbound-docker/var/root.hints; then + if echo "" && wget -nv https://www.internic.net/domain/named.root -O unbound-docker/var/root.hints; then echo "SUCCESS! 'root.hints' file downloaded." else echo "ERROR! 'root.hints' file download failed." fi else - (( DIFF = ($(date +%s) - $(stat -c %Y new))/3600 )) - if [ ${DIFF} -gt 1 ] || echo "${FRESH}" | grep -q 'y'; then + (( DIFF = ($(date +%s) - $(stat -c %Z unbound-docker/var/root.hints))/3600 )) + if ((DIFF > 1)) || echo "${FRESH}" | grep -q 'y'; then if wget -nv https://www.internic.net/domain/named.root -O unbound-docker/var/root.hints; then echo "SUCCESS! 'root.hints' file updated." else