找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: cnyepeng

[其它] 动态域名更新的实现方法

[复制链接]
发表于 2005-10-10 16:16:48 | 显示全部楼层

2.7.14出錯

System-Error: script error: no such command or directory (resolve)
?情?大?
routeros
回复

使用道具 举报

 楼主| 发表于 2005-10-10 16:24:22 | 显示全部楼层
resvlve前要加:最为前缀
routeros
回复

使用道具 举报

发表于 2005-10-11 09:35:02 | 显示全部楼层
在2.7.14 和2.8.11里
就??加的(下附script,)

2.8.11成功了,而2.7.14出?

System-Error: script error: no such command or directory (resolve)


# Setup global variables needed to keep track of changing IP address.
/system script add name="ddnsInit" source={

  :log message="ddnsInit: Creating Dynamic DNS update system."

# ENTER YOUR CHANGEIP.COM USER ID HERE.
  :global u
  :set u "username"

# ENTER YOUR CHANGEIP.COM PASSWORD HERE.
  :global p
  :set p "password"

  :global s
  :set s "Mikrotik"

# ENTER THE TARGET HOSTNAME TO UPDATE, *1 is Set 1.
  :global h
  :set h "*1"

  :global dhcpInterface
  :set dhcpInterface [ /interface find type=pppoe-out ]
  :log message=("ddnsInit: Found dhcp interface " . $dhcpInterface )

# EMAIL PROXY ADDRESS - DO NOT CHANGE FOR PRODUCTION.
  :global ddnsProxyEmail
  :set ddnsProxyEmail "ddnsUpdate@ChangeIP.com"

# ENTER YOUR EMAIL ADDRESS FOR CONFIRMATIONS.
  :global ddnsFromEmail
  :set ddnsFromEmail "username@xxxxx.com"

# SMTP DDNS PROXY SERVER - CHANGE ONLY IF NECESSARY (port 25 blocked?)
  :global ddnsSmtpServer
  :set ddnsSmtpServer [:resolve smtp.changeip.com]

  :global a
  :set a [ \
    /ip address get \
      [/ip address find interface=$dhcpInterface] \
      address \
    ]

  }
routeros
回复

使用道具 举报

 楼主| 发表于 2005-10-11 09:48:10 | 显示全部楼层
有可能2.7版本下的ICE命令里没有:resolve,你可以直接在Terminal下查询一下,操作如下:
admin&MikroTik>:?
这时会列出该版本支持的ICE命令,看看里面有没有resolve,同样,有的话,键入:resolve ?可以查询该命令的语法,我手头没有2.7的,你自己试试。或者你给我一个用户,我帮你试阿
routeros
回复

使用道具 举报

发表于 2005-10-11 10:07:18 | 显示全部楼层

首先3QU能回复,執行 :? 好像沒這個命令

首先3QU
[admin@MikroTik] > :?

         list  list all commands
      execute  run script as separate console job
        local  introduces local variable
       global  introduces global variable
          set  changes variable value
        unset  remove variable
          put  prints argument on the screen
        while  executes command while condition is true
           if  executes command if condition is true
           do  executes command
         time  returns time taken by command to execute
         incr  increments variable
         decr  decrements variable
          for  executes command for a range of integer values
      foreach  executes command for every element in a list
        delay  does nothing for a while
         beep
  environment  list of all variables
          log  send message to logs
routeros
回复

使用道具 举报

发表于 2005-10-11 10:09:14 | 显示全部楼层

2.8有resolve 這個指令

[admin@MikroTik] > :

         list  list all commands
      resolve  preform a dns lookup of domain name
      execute  run script as separate console job
        local  introduces local variable
       global  introduces global variable
          set  changes variable value
        unset  remove variable
          put  prints argument on the screen
        while  executes command while condition is true
           if  executes command if condition is true
           do  executes command
         time  returns time taken by command to execute
         incr  increments variable
         decr  decrements variable
          for  executes command for a range of integer values
      foreach  executes command for every element in a list
        delay  does nothing for a while
          log  send message to logs
         beep
  environment  list of all variables
routeros
回复

使用道具 举报

 楼主| 发表于 2005-10-11 11:11:34 | 显示全部楼层
看来我的估计是对的,2.7里没有这个命令,这个脚本在2.7下腰出错的
routeros
回复

使用道具 举报

发表于 2005-10-11 16:01:08 | 显示全部楼层

回复 #99 cnyepeng 的帖子

2.7.14有??法??ddns,因?台2.7.14已用?年,一直都很?定
routeros
回复

使用道具 举报

 楼主| 发表于 2005-10-11 20:08:05 | 显示全部楼层
最简单的就是带:resolve命令的这句直接set一个ip值啊
routeros
回复

使用道具 举报

 楼主| 发表于 2005-10-11 20:11:42 | 显示全部楼层
我也是从2.7开始用的,看来我们用ros的历史差不多,都有两年多了,只不过你一直忠于原味,我可是中间换了好几个版本,现在用的是2.8的
routeros
回复

使用道具 举报

发表于 2005-10-11 22:09:41 | 显示全部楼层
只因那两台2.7.14,机器较老为166M-32M-200M硬盘
routeros
回复

使用道具 举报

发表于 2005-10-19 16:48:26 | 显示全部楼层
我试了2826 2827都不行 
routeros
回复

使用道具 举报

发表于 2005-12-2 13:37:27 | 显示全部楼层
28.28行不行
routeros
回复

使用道具 举报

发表于 2005-12-2 18:46:13 | 显示全部楼层
很爽哦,谢谢楼主。
routeros
回复

使用道具 举报

发表于 2005-12-3 13:08:44 | 显示全部楼层
楼主能不能做个视频出来
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-8 19:40 , Processed in 0.076875 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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