gluon/package/gluon-legacy/files/lib/gluon/upgrade/290-legacy-simple-tc
Matthias Schiffer 9b172bbaf4 Move all upgrade scripts to a common directory
Moving the scripts to a common directory not only vastly simplifies the
zzz-gluon-upgrade script, but also allows to define an ordering of such
scripts across packages.
2015-01-24 11:27:47 +01:00

30 lines
647 B
Lua
Executable File

#!/usr/bin/lua
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
if sysconfig.gluon_version == 'legacy' then
for _, config in ipairs(site.legacy.tc_configs) do
local s = uci:get_first(config, 'bandwidth')
if s then
old = uci:get_all(config, s)
uci:section('gluon-simple-tc', 'interface', 'mesh_vpn',
{
ifname = 'mesh-vpn',
enabled = old.enabled,
limit_ingress = old.downstream,
limit_egress = old.upstream,
}
)
uci:save('gluon-simple-tc')
uci:commit('gluon-simple-tc')
break
end
end
end