projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
applications/luci-vnstat: move to status menu
[project/luci.git]
/
modules
/
admin-full
/
luasrc
/
model
/
cbi
/
admin_system
/
ipkg.lua
diff --git
a/modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua
b/modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua
index
f161045
..
1db0f11
100644
(file)
--- a/
modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua
+++ b/
modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua
@@
-14,22
+14,21
@@
$Id$
]]--
local ipkgfile = "/etc/opkg.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()
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)
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
return true
end