projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
admin-full: Add timeserver section if it doesn't already exist in /etc/config/system...
[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
4e864df
..
e9ff5b1
100644
(file)
--- a/
modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua
+++ b/
modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua
@@
-2,7
+2,7
@@
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008
Jo-Philipp Wich <xm@leipzig.freifunk.net
>
+Copyright 2008
-2011 Jo-Philipp Wich <xm@subsignal.org
>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@
-12,24
+12,24
@@
You may obtain a copy of the License at
$Id$
]]--
$Id$
]]--
-local ipkgfile = "/etc/ipkg.conf"
-f = SimpleForm("ipkgconf", translate("a_s_p_ipkg"))
+local ipkgfile = "/etc/opkg.conf"
+
+f = SimpleForm("ipkgconf", translate("OPKG-Configuration"))
+
+f:append(Template("admin_system/ipkg"))
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
end
-f:append(Template("admin_system/ipkg"))
+function t.write(self, section, data)
+ return nixio.fs.writefile(ipkgfile, data:gsub("\r\n", "\n"))
+end
function f.handle(self, state, data)
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
return true
end