# http://www.skomy.miase.pl #_______________________________________ :global ddnsuser "user" :global ddnspass "pass" :global ddnshost "host" :global ddnsinterface "interface_name" #_______________________________________ :global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface] address ] :set ddnsip [:pick $ddnsip 0 [:find $ddnsip /]] :global ddnslastip :if ([:len [/interface find name=$ddnsinterface]] = 0 ) do={ :log info ("DDNS: NO INT " . $ddnsinterface) } :if ([ :typeof $ddnslastip ] = "nothing" ) do={ :set ddnslastip 0.0.0.0 } :if ([ :typeof $ddnsip ] = "nothing" ) do={ :log info ("DDNS: NO IP " . $ddnsinterface ) } else={ :if ($ddnsip != $ddnslastip) do={ :log info ("DDNS: UPD " . $ddnsip) :local str "http://members.dyndns.org/nic/update?hostname=$ddnshost&myip=$ddnsip" /tool fetch url=$str user=$ddnsuser password=$ddnspass dst-path=$ddnshost :delay 1 /file remove "$ddnshost" :set ddnslastip $ddnsip } else={ :log info "DDNS: NCHG" } }