风一样的男孩 发表于 2013-4-12 11:36:32

ROS实用脚本教程-3322动态域名解析

ros3.30 5.20等版本测试成功,ROS其它版本没有测试## DDNS for 3322
:local ednsuser "用户名"
:local ednspass "密码"
:local ednshost "域名"
:local ednsinterface "pppoe-out1"
:local members "http://members.3322.org/dyndns/update?system=dyndns"
#:local members "http://members.dyndns.org/nic/update?"
:local status
:local status running]
:if ($status!=false) do={
:local ednslastip [:resolve $ednshost]
:if ([ :typeof $ednslastip ] = nil ) do={ :local ednslastip "0" }
:local ednsiph [ /ip address get address ]
:local ednsip [:pick $ednsiph 0 [:find $ednsiph "/"]]
:local ednsstr "&hostname=$ednshost&myip=$ednsip"
:if ($ednslastip != $ednsip) do={/tool fetch url=($members . $ednsstr) mode=http user=$ednsuser password=$ednspass dst-path=$ednshost
:delay 2
:local result
:log info ($ednshost . " " .$result)
/file remove $ednshost ;
}
}

## end #RouterOS 5.24 1G IMG版自动破解版
页: [1]
查看完整版本: ROS实用脚本教程-3322动态域名解析