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

14 lines
394 B
Plaintext
Raw Normal View History

2020-12-27 00:13:34 -05:00
#!/bin/bash
APIKEY={{ api_key }}
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