请叫我小学生 发表于 2014-7-1 10:29:39

mikrotik routes 6.15 changeip更新脚本

:global ddnsuser "账号"
:global ddnspass "密码"
:global ddnshost "域名"
:global ddnsinterface "接口"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# END OF USER DEFINED CONFIGURATION
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:global ddnssystem ("mt-" . version] )
:global ddnsip [ /ip address get address ]
:global ddnslastip

:if ([:len ] = 0 ) do={ :log info "DDNS: No interface named $ddnsinterface, please check configuration." }
:if ([ :typeof $ddnslastip ] = "nothing" ) do={ :global ddnslastip 0.0.0.0/0 }
:if ([ :typeof $ddnsip ] = "nothing" ) do={
:log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={
:if ($ddnsip != $ddnslastip) do={
:log info "DDNS: Sending UPDATE!"
:log info [ :put ] key-name=$ddnsuser key=$ddnspass ] ]
:global ddnslastip $ddnsip
} else={
:log info "DDNS: No changes necessary."
}

}
# END OF SCRIPT

EDCwifi-潘 发表于 2014-7-1 16:37:12

赞一个!
页: [1]
查看完整版本: mikrotik routes 6.15 changeip更新脚本