mirror of
https://github.com/aaronriedel/hetzner-ddns.git
synced 2024-11-18 00:56:41 +01:00
Make the determination of the public IP more resilient by having a backup provider
This commit is contained in:
parent
b311cc6202
commit
43d20a1108
2 changed files with 6 additions and 0 deletions
3
ddns4.sh
3
ddns4.sh
|
@ -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
|
||||
|
|
3
ddns6.sh
3
ddns6.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue