luci/modules/admin-full/luasrc/model/cbi/admin_system/ipkg.lua

36 lines
793 B
Lua
Raw Normal View History

--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
2008-08-16 16:41:44 +00:00
local ipkgfile = "/etc/opkg.conf"
f = SimpleForm("ipkgconf", translate("OPKG-Configuration"))
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 ""
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
f:append(Template("admin_system/ipkg"))
function f.handle(self, state, data)
return true
end
return f