📄 formcustom.lua.svn-base
字号:
#!/usr/bin/lua-- Copyright (C) 2008 OpenRB.comrequire('fslib')cfgvars = { values = { custom = '' }, params = { id = 'custom', path = '/etc/firewall.user' }}cfg = uci.init('firewall', 'custom', 'include', true)-- read include path from configif (type(cfg) == 'table') then if (cfg['path'] ~= nil) then cfgvars.params.path = cfg['path'] end-- no config entry found, set defaultselse uci.set('firewall', 'custom', 'path', cfgvars.params.path) uci.commit('firewall')end-- make sure custom config file existsos.execute('touch ' .. cfgvars.params.path)-- skip first linecfgvars.values.custom = table.concat(readlines(cfgvars.params.path, 1), "\n");io.write(json.encode(cfgvars))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -