zoukankan      html  css  js  c++  java
  • ros从6..43版本允许把fetch返回来的数值引入变量data去使用。

    原文:

    https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch

    Return value to a variable

    Since RouterOS v6.43 it is possible to save the result of fetch command to a variable. For example, it is possible to trigger a certain action based on the result that a HTTP page returns. You can find a very simple example below that disables ether2 whenever a PHP page returns "0":

    {
        :local result [/tool fetch url=http://10.0.0.1/disable_ether2.php as-value output=user];
        :if ($result->"status" = "finished") do={
            :if ($result->"data" = "0") do={
                /interface ethernet set ether2 disabled=yes;
            } else={
                /interface ethernet set ether2 disabled=no;
            }
        }
    }

    :global abc [/tool fetch url="http://realip.uhaozu.com" mode=http as-value output=user]

    :put ($abc->"data")
    58.240.251.12
    :put ($abc->"status")
    finished

    多了一个全局变量abc,可以在后面引用出来使用。

  • 相关阅读:
    LabelImg 图像图像标注工具
    周杰伦的2000w个故事
    ROS 订阅图像节点(1)
    ROS 订阅图像节点
    ROS 双目标定
    书籍
    Z30云台PC控制问题
    大疆M600组装和试飞
    M100 X3云台安装
    M100 组装教程
  • 原文地址:https://www.cnblogs.com/itfat/p/14958719.html
Copyright © 2011-2022 走看看