Skip to content

Instantly share code, notes, and snippets.

@gerlof85
gerlof85 / ddns_updater.sh
Last active May 14, 2021 10:20 — forked from oliveratgithub/ddns_updater.sh
Automatic Dynamics DNS updater using HTTP API calls, prepared for TwoDNS.de / Two-DNS.de (works with any other DDNS Service, allowing IP updates via HTTP API calls)
#!/bin/sh
log="ddns_updater.log.txt"
my_ext_ip=$(curl -sS http://ipv4.icanhazip.com)
echo "\n\n\n===== \
\n$(date -u) \
\nUpdating IP to: $my_ext_ip \n" >> $log
curl -isSX PUT \
-u "[email protected]:YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{"ip_address":"'$my_ext_ip'", "activate_wildcard": "false"}' \