scripts/ansible/templates/gandi-ddns.sh.j2

14 lines
400 B
Plaintext
Raw Normal View History

2020-12-27 00:13:34 -05:00
#!/bin/bash
2020-12-31 12:48:53 -05:00
APIKEY={{ gandi_api_key }}
2020-12-27 00:13:34 -05:00
NAME=$(hostname --short)
IPV6=$(ip -6 addr | grep mngtmpaddr | head -n 1 | awk '/inet6 / {gsub(/\/.*/,"",$2); print $2}')
curl \
--header "Authorization: Apikey $APIKEY" \
--header "Content-Type: application/json" \
--request PUT \
--data "{\"rrset_values\": [\"$IPV6\"]}" \
https://api.gandi.net/v5/livedns/domains/seaturtle.pw/records/$NAME/AAAA