Você está na página 1de 1

# Define Global Variables :global ddnsipmask :global ddnsip :global ddnslastip :if ([ :typeof $ddnslastip ] = nil ) do={ :global

ddnslastip "0" } :global ddnsinterface "pppoe-ByFly" # Grab the current IP address on that interface. :global ddnsipmask [ /ip address get [/ip address find interface=$ddnsinterface ] address ] :global ddnsip [:pick $ddnsipmask 0 ([:len $ddnsipmask]-3) ] # Did we get an IP address to compare? :if ([ :typeof $ddnsip ] = nil ) do={ :log info ("DynDNS: No ip address present on " . $ddnsinterface . ", please c heck.") } else={ # Did we get correct IP? # :if ([:pick $ddnsip 0 2] != 93 [:pick $ddnsip 0 2] != 82) do={ HERE_I_WA NT_TO_REESTABLISH_PPPOE_CONNECTION } :if ($ddnsip != $ddnslastip) do={ :log info "DynDNS: Sending UPDATE! ($ddnsip)" :log info [/tool dns-update name=someone.myddns.com address=$ddnsip key-name =key key=pass] :global ddnslastip $ddnsip } }

Você também pode gostar