Skip to content

Instantly share code, notes, and snippets.

@ravnoor
Created September 5, 2022 17:41
Show Gist options
  • Save ravnoor/44fe0337c1ed15da54ab8c66c8ff672a to your computer and use it in GitHub Desktop.
Save ravnoor/44fe0337c1ed15da54ab8c66c8ff672a to your computer and use it in GitHub Desktop.
Update dynamic ipv4 and ipv6 address on duckdns.org
DUCKDNS_TOKEN=ffc3496761593d061e9cb57525855266
IPV4=$(ip -json address list eth0 | jq -r '.[0].addr_info[] | select(.family=="inet" and .scope=="global") | .local')
IPV6=$(ip -json address list eth0 | jq -r '.[0].addr_info[] | select(.family=="inet6" and .scope=="global") | .local')
# echo ${IPV4}
# echo ${IPV6}
echo url="https://www.duckdns.org/update?domains=precision&token=${DUCKDNS_TOKEN}&ip=${IPV4}&ipv6=${IPV6}&verbose=true" | curl -k -o /root/infra/duckdns/duck.log -K -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment