applications/luci-vnstat: move to status menu
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_system / ipkg.lua
index 4e864df..1db0f11 100644 (file)
@@ -12,24 +12,23 @@ You may obtain a copy of the License at
 
 $Id$
 ]]--
-local ipkgfile = "/etc/ipkg.conf" 
+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.keys)
-               end
-       end
        return true
 end