2015-01-16 22:38:38 +00:00
|
|
|
-- Copyright 2008 Steven Barth <steven@midlink.org>
|
2015-01-16 22:46:42 +00:00
|
|
|
-- Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
|
2015-01-16 22:38:38 +00:00
|
|
|
-- Licensed to the public under the Apache License 2.0.
|
2011-10-24 01:10:34 +00:00
|
|
|
|
|
|
|
local ipkgfile = "/etc/opkg.conf"
|
2008-08-14 17:16:56 +00:00
|
|
|
|
2009-10-31 15:54:11 +00:00
|
|
|
f = SimpleForm("ipkgconf", translate("OPKG-Configuration"))
|
2008-08-14 17:16:56 +00:00
|
|
|
|
2011-10-24 01:10:34 +00:00
|
|
|
f:append(Template("admin_system/ipkg"))
|
|
|
|
|
2008-08-14 17:16:56 +00:00
|
|
|
t = f:field(TextValue, "lines")
|
|
|
|
t.rows = 10
|
|
|
|
function t.cfgvalue()
|
2009-07-19 00:24:58 +00:00
|
|
|
return nixio.fs.readfile(ipkgfile) or ""
|
2008-08-14 17:16:56 +00:00
|
|
|
end
|
|
|
|
|
2009-01-16 18:18:29 +00:00
|
|
|
function t.write(self, section, data)
|
2009-07-19 00:24:58 +00:00
|
|
|
return nixio.fs.writefile(ipkgfile, data:gsub("\r\n", "\n"))
|
2009-01-16 18:18:29 +00:00
|
|
|
end
|
|
|
|
|
2008-08-14 17:16:56 +00:00
|
|
|
function f.handle(self, state, data)
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
return f
|