I’m using this script on an x86 system with success, but I’m unable to run it at Routerboards (RB450, RB750)
Could somebody help me? I bet the fail is at “fetch” command syntax. Thanks.
_# Define User Variables
:global ddnsuser “xxxxxxxx”
:global ddnspass “xxxxxxx”
:global ddnshost “xxxx.ath.cx”
:global ddnsinterface “PPPoE2”
Define Global Variables
:global ddnsip
:global ddnslastip0
:if ([ :typeof $ddnslastip0 ] = nil ) do={ :global ddnslastip0 “0” }
\
Grab the current IP address on that interface.
:global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface ] address ]
#Quit the mask part from address
:local largo [:len $ddnsip]
:local largo [:put ($largo-3)]
:local nomask [:pick $ddnsip 0 $largo]
:global ddnsip $nomask
\
Did we get an IP address to compare?
:if ([ :typeof $ddnsip ] = nil ) do={
:log info (“DynDNS: No IP at " . $ddnsinterface . “, Pls check.”)
} else={
:if ($ddnsip != $ddnslastip0) do={
:log info (“DynDNS: Updating " $ddnsinterface)
:local str “/nic/update?hostname=$ddnshost&myip=$ddnsip&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG”
/tool fetch address=members.dyndns.org src-path=$str mode=http user=$ddnsuser password=$ddnspass dst-path=(”/DynDNS.”.$ddnshost)
:delay 1
:local str [/file find name=“DynDNS.$ddnshost”];
/file remove $str
:global ddnslastip0 $ddnsip
}
}_