* Fixed Freifunk wizard
This commit is contained in:
parent
9d8689b09b
commit
17b357af81
2 changed files with 18 additions and 1 deletions
|
@ -7,7 +7,7 @@ require("ffluci.sys")
|
||||||
require("ffluci.model.uci")
|
require("ffluci.model.uci")
|
||||||
|
|
||||||
-- Init state session
|
-- Init state session
|
||||||
uci = ffluci.model.uci.Session("/var/state")
|
uci = ffluci.model.uci.StateSession()
|
||||||
|
|
||||||
|
|
||||||
function main(argv)
|
function main(argv)
|
||||||
|
|
|
@ -55,6 +55,23 @@ function configure_freifunk()
|
||||||
uci:set("network", "ffdhcp", "ipaddr", dhcpip)
|
uci:set("network", "ffdhcp", "ipaddr", dhcpip)
|
||||||
uci:set("network", "ffdhcp", "netmask", uci:get("freifunk", "community", "dhcpmask"))
|
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")
|
local splash = uci:show("luci_splash")
|
||||||
if splash then
|
if splash then
|
||||||
for k, v in pairs(splash.luci_splash) do
|
for k, v in pairs(splash.luci_splash) do
|
||||||
|
|
Loading…
Reference in a new issue