找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3850|回复: 5

[脚本] ros-2.9.27-脚本问题

[复制链接]
发表于 2007-2-22 12:08:25 | 显示全部楼层 |阅读模式

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

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

×
遇到点脚本问题,下面的写法有错吗,都不行.
/interface pppoe-client monitor adsl-1 once do={:set pppzt1 $status}
:if ($pppzt1="connected") do={
:set 222 [/ip address get [/ip address find interface=adsl-1] network]}
在终端运行上面的没提示出错,运行下面的,也都能取值.
/interface pppoe-client monitor adsl-1 once
/ip address get [/ip address find interface=adsl-1] network
谢谢!
routeros
发表于 2007-2-22 12:50:53 | 显示全部楼层
你把:set改为:global看看
routeros
回复

使用道具 举报

 楼主| 发表于 2007-2-22 23:37:53 | 显示全部楼层
不行的.
routeros
回复

使用道具 举报

 楼主| 发表于 2007-2-22 23:48:25 | 显示全部楼层
这好像是个不好解决的问题,动态拨号的状态怎么取值?  
哪位有好办法呢
routeros
回复

使用道具 举报

发表于 2007-2-23 11:21:37 | 显示全部楼层
可以取得RUN的情况,CONNENTED不知道怎么取
get pppoe-out1 run
返回true就是运行了
routeros
回复

使用道具 举报

发表于 2007-2-23 23:00:08 | 显示全部楼层
变量要在套用之前声明
只针对本脚本你用SET或local都可以,全局就用global


  1. :local pppzt1
  2. /interface pppoe-client monitor adsl-1 once do={:set pppzt1 $status}
  3. :if ($pppzt1="connected") do={
  4. :set 222 [/ip address get [/ip address find interface=adsl-1] network]}
复制代码
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-28 20:13 , Processed in 0.051626 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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