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 | |
path="/usr/local/bin/twodns/" | |
# create file if it doesn't exist | |
if ! test -f $path"current_ip.txt"; then | |
echo "empty" > $path"current_ip.txt" | |
fi | |
ip_address=`cat /usr/local/bin/twodns/current_ip.txt` |
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"}' \ |