I am using a different username here because I cant seem to recover my old password on this board , it has been a while since I last posted a question.
Here goes:
I have a DYNDNS account , I use the Sowell style scripts to adjust SA-dst address’ on my tunnels, been working well forever.
Now I have a need to update a DYNDNS hostname for a standby Tik, in case our main goes down.
I want to do it manually with a script , no need for variable get or fetches, just the simple one line of code to update my account with a hostname and address from a Tik.
I tried hacking up a couple of scripts here to get the command to do it without variables…no luck.
so ,
I want to update MYTIK.DYNDNS.ORG with address 1.1.1.1 my username=username my password=password
Can you help me with the right command to update this account?
I have no need for variable or parsing, comparing, this Tik is online with a static address, and I just want a script to update DYNDNS hostname it is in standby for, manually if needed after a failure. nothing automatic.
In a one line you could use this:
/tool fetch user=$username password=$password mode=https address="members.dyndns.org" src-path="nic/update\3Fsystem=dyndns&hostname=$hostname&myip=$currentIP&wildcard=no" dst-path="/dyndns.txt"
Below is a script I setup for updating some routers. It goes online and determines the WAN IP and if its different then the dynamic IP then it performs an update.
:log info "Checking to see if WAN IP has changed"
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:delay 3
:local result [/file get dyndns.checkip.html contents] #parse the result
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "" -1]
:local DynIP [:pick $result $startLoc $endLoc]
:log info "According to DynDNS the current WAN IP is: $DynIP"
:set currentIP $DynIP
Resolve hostname
:local resolvedIP [:resolve "$hostname"];
/log info "$hostname resolves to: $resolvedIP"
:if ($DynIP != $resolvedIP) do={
:log warning "WAN IP change detected - Updating DNSPark Dynamic IP for $hostname to $DynIP"
/tool fetch user=$username password=$password mode=https address="members.dyndns.org" src-path="nic/update\3Fsystem=dyndns&hostname=$hostname&myip=$currentIP&wildcard=no" dst-path="/dyndns.txt"
:delay 1
: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)