fix(ingress.tjo.cloud/dyndns): check ipv6 only if it has ipv6
Some checks failed
/ lint (push) Failing after 39s
Some checks failed
/ lint (push) Failing after 39s
This commit is contained in:
parent
e996b3107d
commit
a7d7e7b6ff
2 changed files with 29 additions and 27 deletions
|
@ -7,5 +7,8 @@
|
||||||
# The domain your subdomain is registered at. (i.e. foo.com for home.foo.com)
|
# The domain your subdomain is registered at. (i.e. foo.com for home.foo.com)
|
||||||
DOMAIN=ingress.tjo.cloud
|
DOMAIN=ingress.tjo.cloud
|
||||||
|
|
||||||
|
# Enable to make DELETE requests.
|
||||||
|
DESTRUCTIVE=true
|
||||||
|
|
||||||
# Account ID
|
# Account ID
|
||||||
DNSIMPLE_ACCOUNT_ID=155200
|
DNSIMPLE_ACCOUNT_ID=155200
|
|
@ -156,7 +156,6 @@ healthcheck() {
|
||||||
|
|
||||||
while (true); do
|
while (true); do
|
||||||
domain_records=$(dnsimple::record::list)
|
domain_records=$(dnsimple::record::list)
|
||||||
log::debug "domain_records=$domain_records"
|
|
||||||
|
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
log::info "service=$service Discovering public IP address..."
|
log::info "service=$service Discovering public IP address..."
|
||||||
|
@ -179,17 +178,6 @@ while (true); do
|
||||||
configure::single "$domain_records" "$CLOUD_REGION" "$ipv4" "A"
|
configure::single "$domain_records" "$CLOUD_REGION" "$ipv4" "A"
|
||||||
configure::many "$domain_records" "any" "$ipv4" "A"
|
configure::many "$domain_records" "any" "$ipv4" "A"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $ipv6 ]]; then
|
|
||||||
log::warn "type=AAAA IPv6 address wasn't found."
|
|
||||||
else
|
|
||||||
log::info "type=AAAA ip=$ipv6 Found IPv6 address"
|
|
||||||
if healthcheck "[$ipv6]"; then
|
|
||||||
configure::single "$domain_records" "$CLOUD_REGION" "$ipv6" "AAAA"
|
|
||||||
configure::many "$domain_records" "any" "$ipv6" "AAAA"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
log::info "type=A Checking for stale records..."
|
log::info "type=A Checking for stale records..."
|
||||||
echo "$domain_records" | jq -r ".data[] | select(.type == \"A\" and .name != \"$CLOUD_REGION\") | .id" | while read -r record_id; do
|
echo "$domain_records" | jq -r ".data[] | select(.type == \"A\" and .name != \"$CLOUD_REGION\") | .id" | while read -r record_id; do
|
||||||
|
@ -203,6 +191,16 @@ while (true); do
|
||||||
log::info "type=A domain=$record_name ip=$record_ip Healthy..."
|
log::info "type=A domain=$record_name ip=$record_ip Healthy..."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $ipv6 ]]; then
|
||||||
|
log::warn "type=AAAA IPv6 address wasn't found."
|
||||||
|
else
|
||||||
|
log::info "type=AAAA ip=$ipv6 Found IPv6 address"
|
||||||
|
if healthcheck "[$ipv6]"; then
|
||||||
|
configure::single "$domain_records" "$CLOUD_REGION" "$ipv6" "AAAA"
|
||||||
|
configure::many "$domain_records" "any" "$ipv6" "AAAA"
|
||||||
|
fi
|
||||||
|
|
||||||
log::info "type=AAAA Checking for stale records..."
|
log::info "type=AAAA Checking for stale records..."
|
||||||
echo "$domain_records" | jq -r ".data[] | select(.type == \"AAAA\" and .name != \"$CLOUD_REGION\") | .id" | while read -r record_id; do
|
echo "$domain_records" | jq -r ".data[] | select(.type == \"AAAA\" and .name != \"$CLOUD_REGION\") | .id" | while read -r record_id; do
|
||||||
|
@ -216,6 +214,7 @@ while (true); do
|
||||||
log::info "type=AAAA domain=$record_name ip=$record_ip Healthy..."
|
log::info "type=AAAA domain=$record_name ip=$record_ip Healthy..."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
log::info "Sleeping for $sleep_interval seconds..."
|
log::info "Sleeping for $sleep_interval seconds..."
|
||||||
sleep "$sleep_interval"
|
sleep "$sleep_interval"
|
||||||
|
|
Loading…
Reference in a new issue