diff options
author | Steph Enders <steph@senders.io> | 2023-12-28 07:53:05 -0500 |
---|---|---|
committer | Steph Enders <steph@senders.io> | 2023-12-28 07:53:05 -0500 |
commit | 7523f807dd8ef1665c0f8d61d8cdc46ebb673739 (patch) | |
tree | 85c996d4bd25ded389baeaf3df83e293a5c3f9ff | |
parent | 34e0a59ed43da009d2780d19eaff86189d210c95 (diff) |
Add status logging
-rwxr-xr-x | update.sh | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -47,10 +47,25 @@ if [ "$config_ip" != "$actual_ip" ]; then ] } EOF - aws route53 change-resource-record-sets \ + res=$(aws route53 change-resource-record-sets \ --hosted-zone-id $HOSTED_ZONE_ID \ - --change-batch "file://$RECORD_CHANGE_JSON" - + --change-batch "file://$RECORD_CHANGE_JSON") + status=$(jq -r '.ChangeInfo.Status' $res) + + if [ "$status" == "PENDING" ]; then + echo "Change submitted. Overall is Pending! (This is expected)" + exit 0 + else + + if [ "$status" == "SUCCESS" ]; then + echo "Change successful" + exit 0 + else + echo "Non-successful status code: $status" + exit 1 + fi + fi + else echo "$DOMAIN is currently registered properly: $config_ip $actual_ip" fi |