-
-
Save gerlof85/439df8d10968b8282c14919c41458714 to your computer and use it in GitHub Desktop.
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"}' \ | |
https://api.twodns.de/hosts/YOUR_HOSTNAME.dynvpn.de >> $log | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated URL for icanhazip and made field that must be customized more clear