Skip to content
Snippets Groups Projects
Commit f4a3f73f authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-luci-private-wifi: various fixes and cleanup

It would be nice to generalize this to work with multiple radios, maybe by
integrating it into the wifi-config module...
parent 6fc1db3a
No related branches found
No related tags found
No related merge requests found
...@@ -21,9 +21,11 @@ o.default = (ssid and not uci:get_bool(config, primary_iface, "disabled")) and o ...@@ -21,9 +21,11 @@ o.default = (ssid and not uci:get_bool(config, primary_iface, "disabled")) and o
o.rmempty = false o.rmempty = false
o = s:option(Value, "ssid", translate("Name (SSID)")) o = s:option(Value, "ssid", translate("Name (SSID)"))
o:depends("enabled", '1')
o.default = ssid o.default = ssid
o = s:option(Value, "key", translate("Key"), translate("8-63 characters")) o = s:option(Value, "key", translate("Key"), translate("8-63 characters"))
o:depends("enabled", '1')
o.datatype = "wpakey" o.datatype = "wpakey"
o.default = uci:get(config, primary_iface, "key") o.default = uci:get(config, primary_iface, "key")
...@@ -36,20 +38,20 @@ function f.handle(self, state, data) ...@@ -36,20 +38,20 @@ function f.handle(self, state, data)
if data.enabled == '1' then if data.enabled == '1' then
-- set up WAN wifi-iface -- set up WAN wifi-iface
local t = uci:get_all(config, name) or {} uci:section(config, "wifi-iface", name,
{
t.device = device device = device,
t.network = "wan" network = "wan",
t.mode = 'ap' mode = 'ap',
t.encryption = 'psk2' encryption = 'psk2',
t.ssid = data.ssid ssid = data.ssid,
t.key = data.key key = data.key,
t.disabled = "false" disabled = 0,
}
uci:section(config, "wifi-iface", name, t) )
else else
-- disable WAN wifi-iface -- disable WAN wifi-iface
uci:set(config, name, "disabled", "true") uci:set(config, name, "disabled", 1)
end end
end) end)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment