Error updating dynamic dns entry nohost

21-Jun-2016 02:47 by 9 Comments

Error updating dynamic dns entry nohost - elucidating the secretion proteome of human

But the IP address in the dyndns entry will still be the previous IP before the last time the script ran./tool fetch user=$username password=$password mode=http address="members.dyndns.org" \ src-path="nic/update?system=dyndns&hostname=$hostname&myip=$current IP&wildcard=no" \ dst-path="/dyndns.txt"I believe parsing the html page that is returned after executing this and testing to see if the word "good" appears and then containing the update of the previous IP variable in an if statement that checks if the result contains "good" should resolve this issue.

# parse the results of update :local result Len [:len $result] :local start Loc [:find $result "Go" -1] :local end Loc [:find $result "od" -1] :local result Parse [:pick $result $start Loc $end Loc] :log info ("Update was successful: ".$result Parse) :if (($result Parse = "Good") do ={ :log info ("Update was successful: ".$result Parse) :set previous IP $current IP } else={ :log info ("Update Dyn DNS: Update failed!") }This block should catch to see if Good appears in the returned text, and if it does it will allow the previous IP variable to be updated.If it does not appear, it will not happen, but the next time the script is called it should trigger the update again.# Set needed variables:local username "Your User Name":local password "Your Password":local hostname "Your Host Name":global dyndns Force# print some debug info#:log info ("Update Dyn DNS: username = $username")#:log info ("Update Dyn DNS: password = $password")#:log info ("Update Dyn DNS: hostname = $hostname")# get the current IP address from the internet (in case of double-nat)/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html":local result [/file get dyndns.contents]# parse the current IP result:local result Len [:len $result]:local start Loc [:find $result ": " -1]:set start Loc ($start Loc + 2):local end Loc [:find $result "" -1]:local current IP [:pick $result $start Loc $end Loc]:log info "Update Dyn DNS: current IP = $current IP"#get IP from Dyn DNS for our hostname:local resolved IP [:resolve $hostname]:log info ("Update Dyn DNS: resolved IP =$resolved IP")# Remove the # on next line to force an update every single time - useful for debugging, but you could end up getting blacklisted by Dyn DNS!#:set dyndns Force true# Determine if dyndns update is needed# more dyndns updater request details available at (($current IP !I have been trouble shooting a problem with a group of routers that use the script.When the script is run, it will log that no update is needed even though I can see that the resolved IP of the *domain is not the actual IP of the device.

I can manually force the update and it works just fine.

Which means there is something going on with the if statement that decides if the update happens.

After looking at the script I have noticed that the script never checks to see if the update command successfully completes, but the script still changes the value of the previous IP variable.

Meaning, the variable the script uses to compare the current IP with is getting updated even if the actual dyndns update isn't happening.

So if the below line of code ever does not get processed by the servers successfully, the scripts won't know this, but wills till proceed to alter the previous IP variable.

So the next time the script is run, if will see the newly updated previous IP variable and compare it with the contents of the current IP variable.