Add retries to curl ifconfig.co

Fix for #670
This commit is contained in:
Stanislas Lange 2020-08-03 17:35:56 +02:00
parent e52a54b92f
commit e33cb136dd
No known key found for this signature in database
GPG Key ID: 710D9597C7EAD8CF

View File

@ -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