Hi Guys n Gals,
does anyone have a working script for Updating DNS on Spdns.de?
Thanks!
# Set needed variables
:local password "YOUR-PASSWORD"
:local hostname "YOUR-HOSTNAME"
:global dyndnsForce
:global previousIP
# print some debug info
:log info ("UpdateDynDNS: hostname = $hostname")
:log info ("UpdateDynDNS: previousIP = $previousIP")
# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="checkip4.spdns.de" src-path="/" dst-path="/dyndns.checkip.html"
:local result [/file get dyndns.checkip.html contents]
:local currentIP $result
:log info "UpdateDynDNS: currentIP = $currentIP"
# Remove the # on next line to force an update every single time - useful for debugging,
# but you could end up getting blacklisted by DynDNS!
#:set dyndnsForce true
# Determine if dyndns update is needed
# more dyndns updater request details available at Perform Update - Dyn
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:set previousIP $currentIP
/tool fetch mode=https address="update.spdyn.de" \
src-path="nic/update?hostname=$hostname&myip=$currentIP&user=$hostname&pass=$password" dst-path="/dyndns.txt"
:local result [/file get dyndns.txt contents]
:log info ("UpdateDynDNS: Dyndns update needed")
:log info ("UpdateDynDNS: Dyndns Update Result: ".$result)
:put ("Dyndns Update Result: ".$result)
} else={
:log info ("UpdateDynDNS: No dyndns update needed")
}
:global currentIP;
:local password "YOUR-PASSWORD"
:local hostname "YOUR-HOSTNAME"
:local tmpIP [/ip address get [find interface="pppoe-out1"] address];
:local myIP [:pick $tmpIP 0 [:find $tmpIP "/"]];
:if ($myIP != $currentIP) do={
:log info "WAN IP address changed from $currentIP to $myIP"
:set currentIP $myIP;
/tool fetch mode=https address="update.spdyn.de" \
src-path="nic/update?hostname=$hostname&myip=$currentIP&user=$hostname&pass=$password" keep-result=no;
}
user=$hostname
:global currentIP;
:local password "XXXXXX";
:local hostname "XXXXXX";
:local tmpIP [/ip address get [find interface="pppoe-out1"] address];
:local myIP [:pick $tmpIP 0 [:find $tmpIP "/"]];
:if ($myIP != $currentIP) do={
:log info "WAN IP address changed from $currentIP to $myIP"
:set currentIP $myIP;
/tool fetch mode=https url="https://update.spdyn.de/nic/update\?hostname=$hostname&myip=$currentIP&user=$hostname&pass=$password" keep-result=no;
}