Fixed bugs in vultr agent
This commit is contained in:
parent
cea35faa0e
commit
76ca7315cc
1 changed files with 3 additions and 3 deletions
|
@ -82,7 +82,7 @@ _update_dns_vultr_get_record_id() {
|
||||||
-H "Authorization: Bearer $agent_update_dns_vultr_token" \
|
-H "Authorization: Bearer $agent_update_dns_vultr_token" \
|
||||||
"https://api.vultr.com/v2/domains/$domain/records?per_page=500")
|
"https://api.vultr.com/v2/domains/$domain/records?per_page=500")
|
||||||
|
|
||||||
record_id="$(echo "$response" | jq --arg subdomain "$subdomain" --arg dtype "$dtype" '.records[] | select(.name==$subdomain and .type==$dtype).id')"
|
record_id="$(sed -e 's/^"//' -e 's/"$//' <<<"$(echo "$response" | jq --arg subdomain "$subdomain" --arg dtype "$dtype" '.records[] | select(.name==$subdomain and .type==$dtype).id')")"
|
||||||
|
|
||||||
if [[ -z "$record_id" ]]
|
if [[ -z "$record_id" ]]
|
||||||
then
|
then
|
||||||
|
@ -97,7 +97,7 @@ if _update_dns_vultr_check_domain "$DIP_DOMAIN"; then
|
||||||
if valid_ipv4 "$DIP_CUR_IP"; then
|
if valid_ipv4 "$DIP_CUR_IP"; then
|
||||||
log "Updating Vultr DNS IPv4 Record: ${DIP_RECORD}.${DIP_DOMAIN} to ${DIP_CUR_IP}"
|
log "Updating Vultr DNS IPv4 Record: ${DIP_RECORD}.${DIP_DOMAIN} to ${DIP_CUR_IP}"
|
||||||
|
|
||||||
if _update_dns_vultr_get_record_id "${DIP_DOMAIN_ID}" "A" "${DIP_RECORD}"
|
if _update_dns_vultr_get_record_id "${DIP_DOMAIN}" "A" "${DIP_RECORD}"
|
||||||
then
|
then
|
||||||
curl --silent \
|
curl --silent \
|
||||||
-X PATCH \
|
-X PATCH \
|
||||||
|
@ -113,7 +113,7 @@ if _update_dns_vultr_check_domain "$DIP_DOMAIN"; then
|
||||||
if valid_ipv6 "$DIP_CUR_IP"; then
|
if valid_ipv6 "$DIP_CUR_IP"; then
|
||||||
log "Updating Linux DNS IPv6 Record: ${DIP_RECORD}.${DIP_DOMAIN} to ${DIP_CUR_IP}"
|
log "Updating Linux DNS IPv6 Record: ${DIP_RECORD}.${DIP_DOMAIN} to ${DIP_CUR_IP}"
|
||||||
|
|
||||||
if _update_dns_vultr_get_record_id "${DIP_DOMAIN_ID}" "AAAA" "${DIP_RECORD}"
|
if _update_dns_vultr_get_record_id "${DIP_DOMAIN}" "AAAA" "${DIP_RECORD}"
|
||||||
then
|
then
|
||||||
curl --silent \
|
curl --silent \
|
||||||
-X PATCH \
|
-X PATCH \
|
||||||
|
|
Loading…
Reference in a new issue