move to project lifecycle structure
This commit is contained in:
20
systemd/graduated/ddns/ddns.sh
Executable file
20
systemd/graduated/ddns/ddns.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get public IP address (there are many ways to do it, I picked this way)
|
||||
PUBLIC_IP=$(curl -4 ifconfig.me)
|
||||
|
||||
# Update reeselink records
|
||||
cat /etc/ddns/reeselink_record_template.json \
|
||||
| jq '.Changes[0].ResourceRecordSet.ResourceRecords[0].Value = "'$PUBLIC_IP'"' \
|
||||
> /etc/ddns/reeselink_record.json
|
||||
|
||||
# Update reeseapps records
|
||||
cat /etc/ddns/reeseapps_record_template.json \
|
||||
| jq '.Changes[].ResourceRecordSet.ResourceRecords[0].Value = "'$PUBLIC_IP'"' \
|
||||
> /etc/ddns/reeseapps_record.json
|
||||
|
||||
# Update reeselink records
|
||||
aws route53 change-resource-record-sets --hosted-zone-id Z0092652G7L97DSINN18 --change-batch file:///etc/ddns/reeselink_record.json
|
||||
|
||||
# Update reeseapps records
|
||||
aws route53 change-resource-record-sets --hosted-zone-id Z012820733346FJ0U4FUF --change-batch file:///etc/ddns/reeseapps_record.json
|
||||
Reference in New Issue
Block a user