⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 saverule.lua.svn-base

📁 嵌入式无线路由系统openwrt的web配置工具
💻 SVN-BASE
字号:
#!/usr/bin/lua-- Copyright (C) 2008 OpenRB.comrequire('fslib')data = datajson()if (data ~= nil and data['values'] ~= nil) then  file = 'firewall'  ruletype = 'rule'  if (data['values']['target'] == 'FORWARD') then    ruletype = 'redirect'    data['values']['dest_port'] = data['values']['dest_dport']    data['values']['target'] = ''    data['values']['dest_dport'] = nil  end  if (data['id'] == nil) then    data['id'] = uci.addsection(file, ruletype)  else    uci.init(file, data['id'], ruletype, true)  end  for field, value in pairs(data['values']) do    uci.setvalue(file, data['id'], field, value)  end  uci.commit(file)end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -