X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-meshwizard%2Fluasrc%2Fmodel%2Fcbi%2Ffreifunk%2Fmeshwizard.lua;h=8cb08228753020cdf9baa36067667e43f9bf9e60;hp=f4478f61cc9e373c0892ecaa69ecc81739a4e3d3;hb=f443bcaca6903464376a3dcf548035396c73e0bc;hpb=1f1aaf1a66d05a9bc3238cbbeb9a19b59d354e82 diff --git a/applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua b/applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua index f4478f61c..8cb082287 100644 --- a/applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua +++ b/applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua @@ -10,6 +10,7 @@ local mesh_network = ip.IPv4(uci:get_first(community, "community", "mesh_network local community_ipv6 = uci:get_first(community, "community", "ipv6") or 0 local community_ipv6mode = uci:get_first(community, "community", "ipv6_config") or "static" local meshkit_ipv6 = uci:get("meshwizard", "ipv6", "enabled") or 0 +local community_vap = uci:get_first(community, "community", "vap") or 0 m = Map("meshwizard", translate("Wizard"), translate("This wizard will assist you in setting up your router for Freifunk " .. "or another similar wireless community network.")) @@ -117,7 +118,7 @@ uci:foreach("wireless", "wifi-device", function(section) chan:value('default') local iwinfo = sys.wifi.getiwinfo(device) - if iwinfo then + if iwinfo and iwinfo.freqlist then for _, f in ipairs(iwinfo.freqlist) do if not f.restricted then chan:value(f.channel) @@ -142,11 +143,18 @@ uci:foreach("wireless", "wifi-device", function(section) end -- Enable VAP - if hwtype == "atheros" then + local supports_vap = 0 + if sys.call("/usr/bin/meshwizard/helpers/supports_vap.sh " .. device .. " " .. hwtype) == 0 then + supports_vap = 1 + end + if supports_vap == 1 then local vap = n:taboption(device, Flag, device .. "_vap", translate("Virtual Access Point (VAP)"), translate("This will setup a new virtual wireless interface in Access Point mode.")) vap:depends(device .. "_dhcp", "1") vap.rmempty = true + if community_vap == "1" then + vap.default = "1" + end end end)