Skip to content

Commit

Permalink
fixed root.hints downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
Cielquan committed Aug 6, 2019
1 parent 62c1d7f commit 535cc44
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 535cc44

Please sign in to comment.