]]--
local ipkgfile = "/etc/opkg.conf"
-f = SimpleForm("ipkgconf", translate("a_s_p_ipkg"))
+f = SimpleForm("ipkgconf", translate("OPKG-Configuration"))
t = f:field(TextValue, "lines")
t.rows = 10
function t.cfgvalue()
- return luci.fs.readfile(ipkgfile) or ""
+ return nixio.fs.readfile(ipkgfile) or ""
+end
+
+function t.write(self, section, data)
+ return nixio.fs.writefile(ipkgfile, data:gsub("\r\n", "\n"))
end
f:append(Template("admin_system/ipkg"))
function f.handle(self, state, data)
- if state == FORM_VALID then
- if (luci.fs.readfile(ipkgfile) or "") ~= data.lines then
- luci.fs.writefile(ipkgfile, data.lines)
- end
- end
return true
end