From e33cb136ddb2ad5a3153abf6a11ac86aad4822a8 Mon Sep 17 00:00:00 2001 From: Stanislas Lange Date: Mon, 3 Aug 2020 17:35:56 +0200 Subject: [PATCH] Add retries to curl ifconfig.co Fix for #670 --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index c0fe624..eb2edbf 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -616,9 +616,9 @@ function installOpenVPN() { # Behind NAT, we'll default to the publicly reachable IPv4/IPv6. if [[ $IPV6_SUPPORT == "y" ]]; then - PUBLIC_IP=$(curl https://ifconfig.co) + PUBLIC_IP=$(curl --retry 5 --retry-connrefused https://ifconfig.co) else - PUBLIC_IP=$(curl -4 https://ifconfig.co) + PUBLIC_IP=$(curl --retry 5 --retry-connrefused -4 https://ifconfig.co) fi ENDPOINT=${ENDPOINT:-$PUBLIC_IP} fi