forked from kassner/route53-ddns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
11 lines (7 loc) · 773 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
IP=`curl -q checkip.amazonaws.com`
HOSTNAME="gatekeeper.altmann.it"
ZONEID="HOSTEDZONEIDGOESHERE"
#######################
XML="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ChangeResourceRecordSetsRequest xmlns=\"https://route53.amazonaws.com/doc/2013-04-01/\"><ChangeBatch><Changes><Change><Action>UPSERT</Action><ResourceRecordSet><Name>${HOSTNAME}.</Name><Type>A</Type><TTL>600</TTL><ResourceRecords><ResourceRecord><Value>${IP}</Value></ResourceRecord></ResourceRecords></ResourceRecordSet></Change></Changes></ChangeBatch></ChangeResourceRecordSetsRequest>"
perl dnscurl.pl --keyfile aws-secrets --keyname my-aws-account -- -X POST -d "${XML}" -H "Content-Type: text/xml; charset=UTF-8" https://route53.amazonaws.com/2013-04-01/hostedzone/${ZONEID}/rrset