找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4049|回复: 2

[其它] 3322的ddns脚本有谁有啊 给分享下。谢谢了

[复制链接]
发表于 2011-12-16 17:54:23 | 显示全部楼层 |阅读模式

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

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

×
3322的ddns脚本有谁有啊 给分享下。谢谢了
:local ednsuser "sss"
:local ednspass "sss"
:local ednshost "sss.3322.org"
: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 [/interface get [/interface find  name=$ednsinterface] running]
:if ($status!=false) do={
:local ednslastip [:resolve $ednshost]
:if ([ :typeof $ednslastip ] = nil ) do={ :local ednslastip "0" }
:local ednsiph [ /ip address get [/ip address find interface=$ednsinterface ] 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 [/file get $ednshost contents]
:log info ($ednshost . " " .$result)
/file remove $ednshost ;
}
}

这个脚本网上找的我用不了。请高手给分析下呢


routeros
发表于 2011-12-17 14:25:14 | 显示全部楼层
:local ednsuser "sss"(这里SSS是用户名)
:local ednspass "sss"(这里的SSS是密码)
:local ednshost "sss.3322.org"(这里是你申请的域名)
:local ednsinterface "pppoe-out1"(这里是对应你的ADSL拔号的名字)
:local members "http://members.3322.org/dyndns/update?system=dyndns"
#:local members "http://members.dyndns.org/nic/update?"
:local status
:local status [/interface get [/interface find  name=$ednsinterface] running]
:if ($status!=false) do={
:local ednslastip [:resolve $ednshost]
:if ([ :typeof $ednslastip ] = nil ) do={ :local ednslastip "0" }
:local ednsiph [ /ip address get [/ip address find interface=$ednsinterface ] 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 [/file get $ednshost contents]
:log info ($ednshost . " " .$result)
/file remove $ednshost ;
}
}

按照上面的改完就可以了。。。
routeros
回复

使用道具 举报

发表于 2011-12-20 17:24:11 | 显示全部楼层
谢谢,收藏了
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-24 12:02 , Processed in 0.055641 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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