# Set needed variables
:local username "user"
:local password "password"
:local hostname "domain"
:global dyndnsForce
:global previousIP
# print some debug info
:log info ("UpdateDnsExit: username = $username")
:log info ("UpdateDnsExit: password = $password")
:log info ("UpdateDnsExit: hostname = $hostname")
:log info ("UpdateDnsExit: previousIP = $previousIP")
# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="ip.dnsexit.com" src-path="/" dst-path="/dnsexit.tmp" port=80 host=ip.dnsexit.com
:local result [/file get [/file find name=dnsexit.tmp] contents]
# parse the current IP result
:local resultLen [:len $result]
:local currentIP [:pick $result 0 ($resultLen-1)]
:log info "UpdateDnsExit: 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
DynDNS.com - Support -- Developers' Connection -- Update Specifications: Perform Update
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:set previousIP $currentIP
:log info "$currentIP or $previousIP"
/tool fetch mode=http address="www.dnsexit.com" \
src-path="RemoteUpdate.sv?login=$username&password=$password&host=$hostname&myip=$currentIP" \
dst-path="/dnsexit.txt" port=80 host=www.dnsexit.com
:local result [/file get dnsexit.txt contents]
:log info ("DnsExit: DnsExit update needed")
:log info ("UpdateDnsExit: DnsExit Update Result: ".$result)
:log info ("DnsExit Update Result: ".$result)
} else={
:log info ("UpdateDnsExit: No dnsexit update needed")
}