找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 18283|回复: 18

[脚本] 3322域名更新脚本

  [复制链接]
发表于 2012-2-15 11:47:50 | 显示全部楼层 |阅读模式

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

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

×
脚本默认更新接口为PPPOE-OUT2的IP,如果PPPOE-OUT2掉线状态,则更新PPPOE-OUT1的线路IP

防止PPPOE-OUT2掉线了无法远程进入ros

我这里的ADSL线路不稳定 掉线掉怕了,自己的ROS有10条线的检测更新

想检测多的线路自己在脚本里面添加内容就行了,脚本免费共享,不收铜板!

3322域名DDNS脚本(双ADSL判断更新).rar (793 Bytes, 下载次数: 287)



routeros
发表于 2012-2-15 22:07:28 | 显示全部楼层
支持,多谢,12号起,我的3322就更新不了,不知是不是3322在搞什么,
routeros
回复

使用道具 举报

发表于 2012-10-17 20:53:17 | 显示全部楼层
非常感谢 脚本很好用 目前ROS 5.21
routeros
回复

使用道具 举报

发表于 2012-10-18 09:16:15 | 显示全部楼层
求助一下楼主 如何添加更多的线路检测啊?
routeros
回复

使用道具 举报

发表于 2012-10-18 13:16:27 | 显示全部楼层
ROS 5.21你哪里下的ISO包或者IMG包

点评

官方下载 我是RB450G RBSXT  发表于 2012-10-18 14:08
routeros
回复

使用道具 举报

发表于 2012-10-18 15:51:57 | 显示全部楼层
我按照楼主的脚本 改成了15线检测 呵呵
:do {
:local ether
:local user  DDNS帐号
:local pass  DDNS密码
:local host  DDNS域名
#以下不需要修改
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out1"] running];
:if ($status=true) do={
:set ether "pppoe-out1"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out2"] running];
:if ($status=true) do={
:set ether "pppoe-out2"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out3"] running];
:if ($status=true) do={
:set ether "pppoe-out3"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out4"] running];
:if ($status=true) do={
:set ether "pppoe-out4"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out5"] running];
:if ($status=true) do={
:set ether "pppoe-out5"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out6"] running];
:if ($status=true) do={
:set ether "pppoe-out6"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out7"] running];
:if ($status=true) do={
:set ether "pppoe-out7"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out8"] running];
:if ($status=true) do={
:set ether "pppoe-out8"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out9"] running];
:if ($status=true) do={
:set ether "pppoe-out9"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out10"] running];
:if ($status=true) do={
:set ether "pppoe-out10"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out11"] running];
:if ($status=true) do={
:set ether "pppoe-out11"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out12"] running];
:if ($status=true) do={
:set ether "pppoe-out12"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out13"] running];
:if ($status=true) do={
:set ether "pppoe-out13"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out14"] running];
:if ($status=true) do={
:set ether "pppoe-out14"};
:if ($status=false) do={
:local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out15"] running];
:if ($status=true) do={
:set ether "pppoe-out15"};
:if ($status=false) do={
:set ether "pppoe-out1"}}}}}}}}}}}}}}};
:local oldip [:resolve $host]
:delay 5s
:local newip [ /ip address get [/ip address find interface=$ether ] address ]
:set newip [:pick $newip 0 [:find $newip "/"]]
:if ($oldip != $newip) do={
/tool fetch url=("http://members.3322.org/dyndns/update\?system=dyndns&hostname=\
$host&myip=$newip") mode=http user=$user password=$pass dst-path=$host
:log error ("\BE\C9\B5\C4IP\B5\D8\D6\B7\A3\BA: ".$oldip)
:log error ("\D0\C2\B5\C4IP\B5\D8\D6\B7\A3\BA: ".$newip)
:delay 3s
:local Result [/file get $host contents]
:if ([:find $Result "good"] != "nil") do={
:log error ($host." \B8\FC\D0\C2\B3\C9\B9\A6")
} else={
:log error ($host." \B8\FC\D0\C2\CA\A7\B0\DC")}
/file remove $host}}

点评

为何不写个循环?  发表于 2013-3-21 22:22
routeros
回复

使用道具 举报

发表于 2012-10-20 12:53:50 | 显示全部楼层
谢谢,3322比较好用
routeros
回复

使用道具 举报

发表于 2012-10-20 22:21:30 | 显示全部楼层
谢谢了
routeros
回复

使用道具 举报

发表于 2012-10-20 22:24:45 | 显示全部楼层
非常感谢,3322好用。脚本不错
routeros
回复

使用道具 举报

发表于 2012-12-22 00:08:01 | 显示全部楼层
谢谢楼主,找了很久,就这个可以用3322
routeros
回复

使用道具 举报

发表于 2012-12-22 01:17:17 | 显示全部楼层
下载一个试试,谢谢楼主发贴
routeros
回复

使用道具 举报

发表于 2013-3-19 12:17:42 | 显示全部楼层
很好的东西,有没CHANGEIP的这种双线 DDNS更新脚本?
routeros
回复

使用道具 举报

发表于 2013-3-21 16:25:49 | 显示全部楼层
很好的东西,在淘宝上买个脚本要50元呢。
routeros
回复

使用道具 举报

发表于 2013-3-21 17:14:16 | 显示全部楼层
routeros
回复

使用道具 举报

发表于 2013-3-21 17:33:23 | 显示全部楼层
刚刚测试过ROS 6.0 测试正常
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-4-20 14:50 , Processed in 0.312694 second(s), 18 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

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