1
1
mirror of https://github.com/namibia/openvpn-install.git synced 2024-12-22 06:48:55 +00:00

Add retries to curl ifconfig.co (#708)

Fix for #670
This commit is contained in:
Stanislas 2021-12-13 22:48:27 +01:00 committed by GitHub
parent 6c4d91e5e8
commit 8f83781d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -627,9 +627,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