From d24782088d6227d1c9399a3e7885a56622bb504c Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Tue, 16 Jun 2020 21:42:51 +0100 Subject: [PATCH] Add --retry to curl to fix occasional "Bad Gateway" errors --- dns_scripts/dns_add_duckdns | 2 +- dns_scripts/dns_del_duckdns | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dns_scripts/dns_add_duckdns b/dns_scripts/dns_add_duckdns index ef40efe..9f61c8c 100755 --- a/dns_scripts/dns_add_duckdns +++ b/dns_scripts/dns_add_duckdns @@ -11,7 +11,7 @@ fi domain="$1" txtvalue="$2" -response=$(curl --silent "https://www.duckdns.org/update?domains=${domain}&token=${token}&txt=${txtvalue}") +response=$(curl --retry 5 --silent "https://www.duckdns.org/update?domains=${domain}&token=${token}&txt=${txtvalue}") if [ "$response" != "OK" ]; then echo "Failed to update TXT record for ${domain} at duckdns.org (is the TOKEN valid?)" echo "Response: $response" diff --git a/dns_scripts/dns_del_duckdns b/dns_scripts/dns_del_duckdns index b9b9f9f..f20c664 100755 --- a/dns_scripts/dns_del_duckdns +++ b/dns_scripts/dns_del_duckdns @@ -4,7 +4,7 @@ token=${DUCKDNS_TOKEN:-} domain="$1" -response=$(curl --silent "https://www.duckdns.org/update?domains=${domain}&token=${token}&txt=&clear=true") +response=$(curl --retry 5 --silent "https://www.duckdns.org/update?domains=${domain}&token=${token}&txt=&clear=true") if [ "$response" != "OK" ]; then echo "Failed to update TXT record for ${domain} at duckdns.org (is the TOKEN valid?)" echo "$response"