Update openvpn-install.sh

replace ifconfig with freeipapi
This commit is contained in:
Saeed Vaziry 2023-01-03 12:41:40 +01:00 committed by GitHub
parent 090915ff0d
commit 02deba32e0
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. # Behind NAT, we'll default to the publicly reachable IPv4/IPv6.
if [[ $IPV6_SUPPORT == "y" ]]; then if [[ $IPV6_SUPPORT == "y" ]]; then
PUBLIC_IP=$(curl --retry 5 --retry-connrefused https://freeipapi.com/ip) PUBLIC_IP=$(curl --retry 5 --retry-connrefused freeipapi.com)
else else
PUBLIC_IP=$(curl --retry 5 --retry-connrefused -4 https://freeipapi.com/ip) PUBLIC_IP=$(curl --retry 5 --retry-connrefused -4 freeipapi.com)
fi fi
ENDPOINT=${ENDPOINT:-$PUBLIC_IP} ENDPOINT=${ENDPOINT:-$PUBLIC_IP}
fi fi