summaryrefslogtreecommitdiffhomepage
path: root/module
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-04-27 22:26:05 +0000
committerSteven Barth <steven@midlink.org>2008-04-27 22:26:05 +0000
commit17b357af81fef5f946c1df6e8966dc4158d4bdbc (patch)
tree0cfc06548f6b30790479738ef06e334b8ad67276 /module
parent9d8689b09bff055caabff87c1ee392043dd25f57 (diff)
* Fixed Freifunk wizard
Diffstat (limited to 'module')
-rw-r--r--module/admin-core/src/controller/admin/index.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/module/admin-core/src/controller/admin/index.lua b/module/admin-core/src/controller/admin/index.lua
index e6b39f8a06..8bd04dd804 100644
--- a/module/admin-core/src/controller/admin/index.lua
+++ b/module/admin-core/src/controller/admin/index.lua
@@ -55,6 +55,23 @@ function configure_freifunk()
uci:set("network", "ffdhcp", "ipaddr", dhcpip)
uci:set("network", "ffdhcp", "netmask", uci:get("freifunk", "community", "dhcpmask"))
+ local dhcp = uci:show("dhcp")
+ if dhcp then
+ for k, v in pairs(dhcp.dhcp) do
+ if v[".type"] == "dhcp" and v.interface == "ffdhcp" then
+ uci:del("dhcp", k)
+ end
+ end
+
+ local dhcpbeg = 48 + tonumber(ip:match("[0-9]+$")) * 4
+
+ local sk = uci:add("dhcp", "dhcp")
+ uci:set("dhcp", sk, "interface", "ffdhcp")
+ uci:set("dhcp", sk, "start", dhcpbeg)
+ uci:set("dhcp", sk, "limit", (dhcpbeg < 252) and 3 or 2)
+ uci:set("dhcp", sk, "leasetime", "30m")
+ end
+
local splash = uci:show("luci_splash")
if splash then
for k, v in pairs(splash.luci_splash) do