I've two router
A) RB962UiGS-5HacT2HnT - Hap ac - ROS 7.5
B) RB760iGS - Hex S - ROS 7.5
The configurations of both are different but very simple and both run this script to update dyndns:
Code: Select all
#uses api.ipfy.org because can be polled very often
#test account to not be blocked!
:set username "test"
:set password "test"
:set hostname "test4.customtest.dyndns.org"
# Set CONFIG
:local dyndnsForce false
:local previousIP [resolve $hostname]
:local useIpify true
# 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
:local currentIP
:if ($useIpify = true) do={
:set currentIP ([/tool fetch url="http://api.ipify.org/" as-value output=user]->"data")
} else={
:local resultArray [/tool fetch url="http://checkip.dyndns.org/" as-value output=user]
:local result ($resultArray->"data")
# parse the current IP result
:local startLoc [:find $result "ddress: " -1]
:set startLoc ($startLoc + 8)
:local endLoc [:find $result "</body>" -1]
:local currentIP [:pick $result $startLoc $endLoc]
}
# Determine if dyndns update is needed
# more dyndns updater request details http://www.dyndns.com/developers/specs/syntax.html
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
:set dyndnsForce false
:set previousIP $currentIP
:log info "DynDNS: currentIP = _$currentIP_ - previous IP = _$previousIP_"
:local UpdResult [/tool fetch url=("https://$username:$password@members.dyndns.org/v3/update?hostname=" \
. $hostname . "&myip=" . $currentIP) as-value output=user];
:log info ("DynDNS: " . $UpdResult->"data")
} else={
#:log info ("DynDNS: No dyndns update needed")
}
The router A shows every time in the log the message
The router B only a cople of time every week.DynDNS: currentIP = _12.34.249.206_ - previous IP = _12.34.249.206_
The strange thing is that every time the two IPs are the same!
So or there is a bug or I'm missing something. And the latter is more probable...
Any thoughts?
Thanks
Nicola