:local ddnsuser "testuser"
:local ddnspass "testpas"
:local status
:local x
:set x 1
:for i from=1 to=$x do={
:local status [/interface get [/interface find name=("TEL-ADSL" . $i)] running]
:if ($status!=true) do={
:set i ($i+1)}
:local ddnsinterface ("TEL-ADSL")
:local ddnshost ("xxx.toh.info")
:local ddnslastip [:resolve $ddnshost]
:if ([ :typeof $ddnslastip ] = nil ) do={ :local ddnslastip "0" }
:local ddnsiph [ /ip address get [/ip address find interface=$ddnsinterface ] address ]
:local ddnsip [:pick $ddnsiph 0 [:find $ddnsiph "/"]]
:if ($ddnsip != $ddnslastip) do={
/tool dns-update name=$ddnshost address=$ddnsip key-name=$ddnsuser key=$ddnspass
:log info ( $ddnshost . " Sending UPDATE!")
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)