diff --git a/src/agents.d/update-dns-linode-v4 b/src/agents.d/update-dns-linode-v4 index 09a344e..675e0b9 100755 --- a/src/agents.d/update-dns-linode-v4 +++ b/src/agents.d/update-dns-linode-v4 @@ -37,6 +37,15 @@ _update_dns_linode_v4_get_domain() { page=$(echo "$response" | jq ".page") total_pages=$(echo "$response" | jq ".pages") + domain_id="$(sed -e 's/^"//' -e 's/"$//' <<<"$(echo "$response" | jq --arg domain "$DIP_RECORD" '.data[] | select(.domain==$domain).id')")" + if [[ -n "$domain_id" ]] + then + _sub_domain="" + _domain=$DIP_RECORD + _domain_id=$domain_id + return 0 + fi + while true do h=$(printf "%s" "$DIP_RECORD" | cut -d . -f $i-100)