1 -- Copyright 2016 Eric Luehrsen <ericluehrsen@hotmail.com>
2 -- Licensed to the public under the Apache License 2.0.
5 local filename = "/etc/unbound/unbound_ext.conf"
6 local description = translatef("Here you may edit 'forward:' and 'remote-control:' in an extended 'include:'")
7 description = description .. " (" .. filename .. ")"
9 m4 = SimpleForm("editing", nil)
10 m4:append(Template("unbound/css-editing"))
11 m4.submit = translate("Save")
13 s4 = m4:section(SimpleSection, "Unbound Extended Conf", description)
14 frm = s4:option(TextValue, "data")
15 frm.datatype = "string"
19 function frm.cfgvalue()
20 return nixio.fs.readfile(filename) or ""
24 function frm.write(self, section, data)
25 return nixio.fs.writefile(filename, luci.util.trim(data:gsub("\r\n", "\n")))