X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=applications%2Fluci-app-mwan3%2Fluasrc%2Fmodel%2Fcbi%2Fmwan%2Fnotify.lua;h=6f87a3d750b2c89294e35e266fbf77a87e83d207;hb=c38117d2ad91fe2a912e1cfcb9949bb20371127d;hp=8746072eba9bc689a14d3d7e4ef21a6fd5b348b9;hpb=6ac76568e770082ade633370b4e287cc9a0f4f1b;p=project%2Fluci.git diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua index 8746072eb..6f87a3d75 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua @@ -1,11 +1,13 @@ --- ------ hotplug script configuration ------ -- - -fs = require "nixio.fs" -ut = require "luci.util" +-- Copyright 2014 Aedan Renner +-- Copyright 2018 Florian Eckert +-- Licensed to the public under the GNU General Public License v2. +local fs = require "nixio.fs" +local ut = require "luci.util" script = "/etc/mwan3.user" -m5 = SimpleForm("luci", nil) + +m5 = SimpleForm("luci", translate("MWAN - Notification")) f = m5:section(SimpleSection, nil, translate("This section allows you to modify the content of \"/etc/mwan3.user\".
" .. @@ -27,13 +29,13 @@ f = m5:section(SimpleSection, nil, "
")) t = f:option(TextValue, "lines") - t.rmempty = true - t.rows = 20 - function t.cfgvalue() - return fs.readfile(script) - end - function t.write(self, section, data) -- format and write new data to script - return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n") - end +t.rmempty = true +t.rows = 20 +function t.cfgvalue() + return fs.readfile(script) +end +function t.write(self, section, data) + return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n") +end return m5