add the ability to select public ip picker apis into one array

pull/11/head
cindrmon 4 years ago
parent ca4d5fd535
commit cc7bcfd186
No known key found for this signature in database
GPG Key ID: C73973DF84F26190
  1. 12
      cloudflare-template.sh

@ -13,9 +13,17 @@ proxy=false # Set the proxy to true or fa
########################################### ###########################################
## Check if we have a public IP ## Check if we have a public IP
########################################### ###########################################
ip=$(curl -s https://api.ipify.org || curl -s https://ipv4.icanhazip.com/)
if [ "${ip}" == "" ]; then ## Public IP Sources/APIs
public_ip_sources=(
"https://api.ipify.org/"
"https://ipv4.icanhazip.com/"
"https://dynamicdns.park-your-domain.com/getip"
)
ip=$(curl -s ${public_ip_sources[@]})
if [[ $ip == "" ]]; then
logger -s "DDNS Updater: No public IP found" logger -s "DDNS Updater: No public IP found"
exit 1 exit 1
fi fi

Loading…
Cancel
Save