Commit 8bdae04b authored by Kasalehlia's avatar Kasalehlia
Browse files

mesh-vpn: recognise parker as vpn type

at least concerning traffic limits
parent d9ffff3a
......@@ -8,6 +8,8 @@ if unistd.access('/lib/gluon/mesh-vpn/fastd') then
vpn = 'fastd'
elseif unistd.access('/lib/gluon/mesh-vpn/tunneldigger') then
vpn = 'tunneldigger'
elseif unistd.access('/lib/gluon/mesh-vpn/parker') then
vpn = 'parker'
end
local vpn_config = {
......@@ -18,11 +20,13 @@ local vpn_config = {
}
uci:delete('simple-tc', 'mesh_vpn')
uci:section('simple-tc', 'interface', 'mesh_vpn', {
ifname = 'mesh-vpn',
enabled = vpn_config.limit_enabled,
limit_egress = vpn_config.limit_egress,
})
if vpn ~= 'parker' then
uci:section('simple-tc', 'interface', 'mesh_vpn', {
ifname = 'mesh-vpn',
enabled = vpn_config.limit_enabled,
limit_egress = vpn_config.limit_egress,
})
end
if vpn == 'fastd' then
uci:set('fastd', 'mesh_vpn', 'enabled', vpn_config.enabled)
......@@ -45,4 +49,15 @@ else
end
uci:save('tunneldigger')
uci:delete('simple-tc', 'client')
if vpn == 'parker' then
uci:section('simple-tc', 'interface', 'client', {
ifname = 'br-client',
enabled = vpn_config.limit_enabled,
-- limits are flipped here
limit_ingress = vpn_config.limit_egress,
limit_egress = vpn_config.limit_ingress,
})
end
uci:save('simple-tc')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment