a922944fee
Drop these unused parameters in the function description, as only the first parameter is referenced within the function block.
30 lines
695 B
Lua
Executable File
30 lines
695 B
Lua
Executable File
#!/usr/bin/lua
|
|
|
|
local site = require 'gluon.site'
|
|
local wireless = require 'gluon.wireless'
|
|
local hash = require 'hash'
|
|
local uci = require('simple-uci').cursor()
|
|
|
|
|
|
local function configure_sae(vif)
|
|
uci:set('wireless', vif, 'encryption', 'sae')
|
|
uci:set('wireless', vif, 'key', site.wifi.mesh.sae_passphrase() or hash.md5(site.prefix6()))
|
|
end
|
|
|
|
wireless.foreach_radio(uci, function(radio)
|
|
local radio_name = radio['.name']
|
|
local vif = 'mesh_' .. radio_name
|
|
local enable = site.wifi.mesh.sae(false)
|
|
|
|
if uci:get('wireless', vif) then
|
|
uci:delete('wireless', vif, 'encryption')
|
|
uci:delete('wireless', vif, 'key')
|
|
|
|
if enable then
|
|
configure_sae(vif)
|
|
end
|
|
end
|
|
end)
|
|
|
|
uci:save('wireless')
|