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 dyndns.org 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. 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=$currentIP&wildcard=no" \
dst-path="/dyndns.txt"
I have added this below the line above to help prevent this from happening.
# parse the results of update
:local resultLen [:len $result]
:local startLoc [:find $result "Go" -1]
:local endLoc [:find $result "od" -1]
:local resultParse [:pick $result $startLoc $endLoc]
:log info ("Update was successful: ".$resultParse)
:if (($resultParse = "Good") do ={
:log info ("Update was successful: ".$resultParse)
:set previousIP $currentIP
} else={
:log info ("UpdateDynDNS: Update failed!")
}