I’m having problems getting the changeip script to run under v3.0rc11 has anyone got a working script or can someone take a look at the following script and tell me where I’ve gone wrong:
If I break the script up it works up until setting the global variable ddnsip but doesn’t like anything thereafter.
:log info "DDNS: Begin"
:global ddnsuser "username"
:global ddnspass "password"
:global ddnshost "hostname"
:global ddnsinterface "adsl"
:global ddnslastip
:global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface] address ]
:if ($ddnslastip = "" ) do={ :global ddnslastip "0.0.0.0/0" }
:if ($ddnsip = "" ) do={
:log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={
:if ($ddnsip != $ddnslastip) do={
:log info "DDNS: Sending UPDATE!"
:log info [ /tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
:global ddns-lastip $ddnsip
} else={
:log info "DDNS: No change"
}
}
:log info "DDNS: End"