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_srv.conf"
6 local description = translatef("Here you may edit the 'server:' clause in an internal 'include:'")
7 description = description .. " (" .. filename .. ")"
9 m3 = SimpleForm("editing", nil)
10 m3:append(Template("unbound/css-editing"))
11 m3.submit = translate("Save")
13 s3 = m3:section(SimpleSection, "Unbound Server Conf", description)
14 frm = s3: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")))