1 -- ------ mwan configuration ------ --
3 ut = require "luci.util"
5 mwanConfig = "/etc/config/mwan3"
8 m5 = SimpleForm("luci", nil)
9 m5:append(Template("mwan/advanced_mwanconfig")) -- highlight current tab
12 f = m5:section(SimpleSection, nil,
13 translate("This section allows you to modify the contents of /etc/config/mwan3"))
15 t = f:option(TextValue, "lines")
20 return nixio.fs.readfile(mwanConfig) or ""
23 function t.write(self, section, data) -- format and write new data to script
24 return nixio.fs.writefile(mwanConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
27 function f.handle(self, state, data)