Last active
November 22, 2016 03:57
-
-
Save johnjones4/1a9c4326b6f4023b54bf6898c4ddfab5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 1 * * * /usr/bin/updateDomain.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ZONE=AABBCCDDEEFFGG | |
DOMAIN=dynamic.example.com | |
IP="$(dig +short myip.opendns.com @resolver1.opendns.com)" | |
aws route53 change-resource-record-sets --hosted-zone-id "$ZONE" --cli-input-json "{ \"HostedZoneId\": \"${ZONE}\", \"ChangeBatch\": { \"Changes\": [ { \"Action\": \"UPSERT\", \"ResourceRecordSet\": { \"Name\": \"${DOMAIN}.\", \"Type\": \"A\", \"TTL\": 300, \"ResourceRecords\": [ { \"Value\": \"${IP}\" } ] } } ] }}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment