2 LuCI - Lua Configuration Interface
4 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 httc://www.apache.org/licenses/LICENSE-2.0
13 local fs = require "nixio.fs"
14 local uci = require "luci.model.uci".cursor()
15 local community = "/etc/config/profile_" .. uci:get("freifunk", "community", "name")
17 f = SimpleForm("community", translate("Community profile"),
18 translate("You can manually edit the selected community profile here."))
20 t = f:field(TextValue, "cop")
24 return fs.readfile(community) or ""
27 function f.handle(self, state, data)
28 if state == FORM_VALID then
30 fs.writefile(cop, data.rcs:gsub("\r\n", "\n"))