找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2894|回复: 0

[脚本] 看看这个DDNS脚本有问题吗

[复制链接]
发表于 2012-8-11 17:02:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
:local Nether
:local Status
:local Ddnshostip
:local Upddns "yes"
:local Ddnsname "用户"
:local Ddnspass "密码"
:local Ddnshost "域名"

:set Ddnshostip [:resolve $Ddnshost]
    :if (([:typeof $Ddnshostip] = "ip")) do={
    :foreach i in=[/interface find type=pppoe-out] do={
        :set Nether [/interface get $i name]
        :set Status [/int get [/int find name=$Nether] running]
        :if ($Status=true) do={
            :if ([/ip rout get [find dynamic=yes static=yes active=yes] interface] = $Nether) do={
                :set Nether [/ip add get [/ip add find dynamic=yes interface=$Nether] address]
                :set Nether [:pick $Nether 0 [:find $Nether "/"]]
                :if ($Ddnshostip = $Nether) do={:set Upddns "no"}
            }
        }
    }
}
:if ($Upddns = "yes") do={/tool dns-update name=$Ddnshost address=127.0.0.255 key-name=$Ddnsname key=$Ddnspass}
routeros
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-17 19:45 , Processed in 0.057386 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表