coolicetea 发表于 2012-2-23 16:28:44

谁能给个3.22的DDNS脚本 论坛里的没有能用的

:global ddnsuser "user"
:global ddnspass "password"
:global ddnshost "my.dyn.ip"
:global ddnsip
:global ddnslastip [:tostr [:resolve $ddnshost] ]
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }
:global ddnsinterface "pppoe-out1"
:global ddnssystem ("mt-" . )
红字的部分 总是提示不对

老刘 发表于 2012-2-23 18:25:47

你的是单线的还是多线的?

coolicetea 发表于 2012-2-23 19:52:16

我是单线PPPOE 拨号

fandl 发表于 2012-2-23 20:06:08

/tool dns-update name=你申请的域名前缀 zone=changeip.net address=127.0.0.255 key-name="用户名"key="密码"

coolicetea 发表于 2012-2-23 20:07:07

多谢楼上我试试

coolicetea 发表于 2012-2-23 20:09:00


> /tool dns-update name=xxxxxx zone=changeip.net address=127.0.0.255 key-name="coolicete
a"key="1xxxxxx"
bad command name dns-update (line 1 column 7)
>

coolicetea 发表于 2012-2-23 20:09:17

看来是无效 。。。。

fandl 发表于 2012-3-17 12:23:21

要在脚本运行。

huigezi' 发表于 2012-3-17 12:33:59

#3322域名更新脚本,默认更新pppoe-out1,如果pppoe-out1掉线即更新pppoe-out2的
#QQ:1337177977apple
:do {
:local ether
#DDNS帐号
:local user"11"
#DDNS密码
:local pass"22"
#DDNS域名地址
:local host"qq.com"
:local status running];
:if ($status=true) do={
:set ether "pppoe-out1"};
:if ($status=false) do={
:set ether "pppoe-out2"};
:local oldip [:resolve $host]
:delay 5s
:local newip [ /ip address get 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 end
:if ([:find $end "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}}

s6510 发表于 2012-3-17 21:11:40

本帖最后由 s6510 于 2012-3-17 21:12 编辑

发一个在用的3322脚本,请笑纳::victory:

:local ednsuser "申请的用户名"
:local ednspass "域名密码"
:local ednshost "申请的动态域名地址"
:local ednsinterface "ADSL"
: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 ;
}
}

s6510 发表于 2012-3-17 21:15:49

本帖最后由 s6510 于 2012-3-17 21:16 编辑

这个是changeip的脚本,我现在绑定两个在用,祝你成功
:global ddnsuser "xxxx"

:global ddnspass "xxxxx"

:global ddnshost "xxxxx.changeip.net"

:global ddnsinterface "ADSL"

:global ddnslastip

:global ddnsip [ /ip address get address ]
: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 [ /tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
    :global ddnslastip $ddnsip
} else={
    :log info "DDNS: No change"
}
}
:log info "DDNS: End"

hulei2008 发表于 2012-3-17 23:22:57

/ip route
:global ddnsint interface]
:global ddnsip [ /ip address get address ]
:global ddnsip [:pick $ddnsip 0 [:find $ddnsip "/"]]
:if ($ddnsip = [:resolve 注册的域名]) do={
      :log info "ddns:No change"
      } else={
   :log info 注册的域名" address=$ddnsip key-name=changeip登录名 key=changeip登录密码]
}

祝你成功,在这里同时感谢专卖精品的指导。。


页: [1]
查看完整版本: 谁能给个3.22的DDNS脚本 论坛里的没有能用的