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

gluon-mesh-batman-adv-*: move MTU configuration to version-specific upgrade scripts

parent 9b172bba
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/lua
local site = require 'gluon.site_config'
local uci = require('luci.model.uci').cursor()
local function configure_mtu(radio, config)
local mesh = 'mesh_' .. radio
if config.mesh_vlan then
uci:set('network', mesh, 'mtu', 1532)
uci:set('network', mesh .. '_vlan', 'mtu', 1528)
else
uci:set('network', mesh, 'mtu', 1528)
end
end
local radios = {}
uci:foreach('wireless', 'wifi-device',
function(s)
table.insert(radios, s['.name'])
end
)
for _, radio in ipairs(radios) do
local hwmode = uci:get('wireless', radio, 'hwmode')
if hwmode == '11g' or hwmode == '11ng' then
configure_mtu(radio, site.wifi24)
elseif hwmode == '11a' or hwmode == '11na' then
configure_mtu(radio, site.wifi5)
end
end
uci:save('network')
uci:commit('network')
#!/usr/bin/lua
local site = require 'gluon.site_config'
local uci = require('luci.model.uci').cursor()
local function configure_mtu(radio, config)
local mesh = 'mesh_' .. radio
if config.mesh_vlan then
uci:set('network', mesh, 'mtu', 1536)
uci:set('network', mesh .. '_vlan', 'mtu', 1532)
else
uci:set('network', mesh, 'mtu', 1532)
end
end
local radios = {}
uci:foreach('wireless', 'wifi-device',
function(s)
table.insert(radios, s['.name'])
end
)
for _, radio in ipairs(radios) do
local hwmode = uci:get('wireless', radio, 'hwmode')
if hwmode == '11g' or hwmode == '11ng' then
configure_mtu(radio, site.wifi24)
elseif hwmode == '11a' or hwmode == '11na' then
configure_mtu(radio, site.wifi5)
end
end
uci:save('network')
uci:commit('network')
......@@ -33,14 +33,12 @@ local function configure_radio(radio, index, config)
uci:section('network', 'interface', mesh,
{
proto = 'none',
mtu = '1532',
}
)
uci:section('network', 'interface', mesh .. '_vlan',
{
ifname = '@' .. mesh .. '.' .. config.mesh_vlan,
proto = 'batadv',
mtu = '1528',
mesh = 'bat0',
}
)
......@@ -48,7 +46,6 @@ local function configure_radio(radio, index, config)
uci:section('network', 'interface', mesh,
{
proto = 'batadv',
mtu = '1528',
mesh = 'bat0',
}
)
......
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