Make the determination of the public IP more resilient by having a backup provider

This commit is contained in:
Aaron Riedel 2023-06-29 16:31:10 +02:00
parent b311cc6202
commit 43d20a1108
2 changed files with 6 additions and 0 deletions

View file

@ -44,6 +44,9 @@ echo -e "${INFO} started $(date)"
echo -e "${INFO} DNS Record will be $SUBDOMAIN_IPV4.$DNSZONE_IPV4"
echo -e "${PENDING} get IP address"
IPv4="$(curl -s4 https://ip.hetzner.com)"
if [[ -z $IPv4 ]]; then
IPv4="$(curl -s4 https://icanhazip.com)"
fi
if [[ -z $IPv4 ]]; then
echo -e "${REPLACE}${FAIL} IPv4 not found"
exit 1

View file

@ -44,6 +44,9 @@ echo -e "${INFO} started $(date)"
echo -e "${INFO} DNS Record will be $SUBDOMAIN_IPV6.$DNSZONE_IPV6"
echo -e "${PENDING} get IP address"
IPv6="$(curl -s6 https://ip.hetzner.com)"
if [[ -z $IPv6 ]]; then
IPv6="$(curl -s6 https://icanhazip.com)"
fi
if [[ -z $IPv6 ]]; then
echo -e "${REPLACE}${FAIL} IPv6 not found"
exit 1