Shell Mikrotic路由器上的Lua脚本
我是LUA的新手,所以对我放松点。 我有以下代码,应该运行到mikrotik路由器中。 你能告诉我它是干什么的吗Shell Mikrotic路由器上的Lua脚本,shell,lua,router,mikrotik,router-os,Shell,Lua,Router,Mikrotik,Router Os,我是LUA的新手,所以对我放松点。 我有以下代码,应该运行到mikrotik路由器中。 你能告诉我它是干什么的吗 :local content :local i #For each mangle in the list :foreach i in=[/ip firewall mangle find comment !=""] do={ #Pull comment out of queue and divide up accordingly :set content [/ip firew
:local content
:local i
#For each mangle in the list
:foreach i in=[/ip firewall mangle find comment !=""] do={
#Pull comment out of queue and divide up accordingly
:set content [/ip firewall mangle get $i comment]
:if ([:find $content "!"] != "") do={
:local pos1 [:find $content "!"]
:local pos4 [:len $content]
:local pos2 ([:find [:pick $content ($pos1+1) $pos4] "!"]+($pos1+1))
:local pos3 ([:find [:pick $content ($pos2+1) $pos4] "!"]+($pos2+1))
这是一个Mikrotik脚本,它在firewall mangle rules中搜索带有注释的规则,并查找带有感叹号“!”的注释 变量
pos1
pos2
pos3
是的第一、第二和第三个位置注释中的代码>
例如:
如果有这样的注释:a!Bcde!fg
变量将是:
pos1=1 pos2=3 pos3=7
位置从零开始,所以第一个位置是0,第二个位置是1
@我以前读过它。。。我想知道细节。+1因为你是第一个问题的新用户:D