gluon/package/gluon-private-wifi/luasrc/lib/gluon/upgrade/325-gluon-private-wifi
David Bauer e729b81312 gluon-private-wifi: add package
Add a package for handling upgrade-scripts speific for the WAN radio
operation.

This way, the config mode interface can be removed seperately from the
core functionality to perform tasks on system upgrade. This can be
useful when the setup-mode is removed entirely for space preservation.
2021-05-02 23:25:32 +02:00

19 lines
424 B
Lua
Executable File

#!/usr/bin/lua
local uci = require("simple-uci").cursor()
local wireless = require 'gluon.wireless'
wireless.foreach_radio(uci, function(radio)
local radio_name = radio['.name']
local suffix = radio_name:match('^radio(%d+)$')
local name = "wan_" .. radio_name
if not uci:get('wireless', name, 'device') then
return
end
uci:set('wireless', name, 'ifname', suffix and 'wan' .. suffix)
end)
uci:save('wireless')