找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4698|回复: 1

[脚本] 脚本高手帮忙修改一个脚本.谢谢

[复制链接]
发表于 2012-1-10 23:27:38 | 显示全部楼层 |阅读模式

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

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

×
  1. :global gate [/ip route get [/ip route find static=yes active=yes dynamic=yes] gateway]
  2. :global xxddns {:put [/ip add get [find network=$gate] interface]}
  3. :global ddnsuser "用户账号"
  4. :global ddnspass "用户密码"
  5. :global ddnshost1 "绑定域名1"
  6. :global ddnshost2 "绑定域名2"
  7. :global ddnshost3 "绑定域名3"
  8. :global ddnsinterface $xxddns
  9. :global ddnslastip

  10. :global ddnsip [ /ip address get [/ip address find dynamic=yes interface=$ddnsinterface ] address ]
  11. :if ( [:typeof $ddnslastip]="nothing" ) do={ :global ddnslastip 0.0.0.0/0 }
  12. :if ( [:typeof $ddnsip]="nothing" ) do={
  13.   :log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
  14. } else={
  15.   :if ($ddnsip != $ddnslastip) do={
  16.     :log info "DDNS: Sending UPDATE!"
  17.     :log info [ /tool dns-update name=$ddnshost1 address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
  18.     :log info [ /tool dns-update name=$ddnshost2 address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
  19.     :log info [ /tool dns-update name=$ddnshost3 address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
  20.     :global ddnslastip $ddnsip
  21.   } else={
  22.     :log info "DDNS: No change"
  23. }
  24. }
  25. :log info "DDNS: End"
复制代码
哪位高手帮忙修改一下能让这脚本在2.9X上用.
routeros
发表于 2012-1-11 15:11:36 | 显示全部楼层

  1. {
  2. #axiang qq47771885
  3. :local Ipaddress ""
  4. :local pname ""
  5. /interface pppoe-client
  6. :for ii from 1 to 4 do={
  7. :set pname ("pppoe-out". $ii)
  8. monitor $pname once do={
  9. :if ($status="connected" && $uptime<00:30:00) do={
  10. :set Ipaddress [/ip address get [/ip address find interface=$pname dynamic=yes] address]
  11. :set Ipaddress [:pick $Ipaddress 0 [:find $Ipaddress "/"]]
  12. /tool dns-update name=("aaaa". $ii . ".xx.com") address=$Ipaddress key-name=aaaa key=bbbb
  13. }}}}
复制代码
适当修改
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 09:58 , Processed in 0.040448 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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