Check IP of subdomain rather than domain

This commit is contained in:
Will Bogey 2018-12-01 10:50:17 -05:00 committed by GitHub
parent 85ee2538ff
commit c9511c3c63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ while ( true ); do
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
$dns_list)
record_id=$(echo $domain_records| jq ".domain_records[] | select(.type == \"A\" and .name == \"$NAME\") | .id")
record_data=$(echo $domain_records| jq -r ".domain_records[] | select(.type == \"A\" and .name == \"@\") | .data")
record_data=$(echo $domain_records| jq -r ".domain_records[] | select(.type == \"A\" and .name == \"$NAME\") | .data")
test -z $record_id && die "No record found with given domain name!"