广告载入中...
# :log info "动态域名服务:开始"
:global ddns-user "ChangeIP帐号"
:global ddns-pass "密码"
:global ddns-host "建立的域名,如:abc.25u.com"
:global ddns-interface "更新那个接口,如pppoe-out1"
:global ddns-system ("mt-" . [/system package get [/system package find name=system] version] )
:global ddns-ip [ /ip address get [/ip address find interface=$ddns-interface] address ]
:if ([ :typeof $ddns-lastip ] = nil ) do={ :global ddns-lastip 0.0.0.0/0 }
:if ([ :typeof $ddns-ip ] = nil ) do={
:log info ("DDNS: No ip address present on " . $ddns-interface . ", please check.") } else={
:if ($ddns-ip != $ddns-lastip) do={
:log info "动态域名服务:发送更新!"
:log info [ /tool dns-update name=$ddns-host address=[:pick $ddns-ip 0 [:find $ddns-ip "/"] ] key-name=$ddns-user key=$ddns-pass ]
:global ddns-lastip $ddns-ip } else={
# :log info "动态域名服务:无变动"
}
}
# :log info "动态域名服务:更新结束"