Skip to content
Snippets Groups Projects
Commit 8bdae04b authored by Kasalehlia's avatar Kasalehlia
Browse files

mesh-vpn: recognise parker as vpn type

at least concerning traffic limits
parent d9ffff3a
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ if unistd.access('/lib/gluon/mesh-vpn/fastd') then ...@@ -8,6 +8,8 @@ if unistd.access('/lib/gluon/mesh-vpn/fastd') then
vpn = 'fastd' vpn = 'fastd'
elseif unistd.access('/lib/gluon/mesh-vpn/tunneldigger') then elseif unistd.access('/lib/gluon/mesh-vpn/tunneldigger') then
vpn = 'tunneldigger' vpn = 'tunneldigger'
elseif unistd.access('/lib/gluon/mesh-vpn/parker') then
vpn = 'parker'
end end
local vpn_config = { local vpn_config = {
...@@ -18,11 +20,13 @@ local vpn_config = { ...@@ -18,11 +20,13 @@ local vpn_config = {
} }
uci:delete('simple-tc', 'mesh_vpn') uci:delete('simple-tc', 'mesh_vpn')
uci:section('simple-tc', 'interface', 'mesh_vpn', { if vpn ~= 'parker' then
ifname = 'mesh-vpn', uci:section('simple-tc', 'interface', 'mesh_vpn', {
enabled = vpn_config.limit_enabled, ifname = 'mesh-vpn',
limit_egress = vpn_config.limit_egress, enabled = vpn_config.limit_enabled,
}) limit_egress = vpn_config.limit_egress,
})
end
if vpn == 'fastd' then if vpn == 'fastd' then
uci:set('fastd', 'mesh_vpn', 'enabled', vpn_config.enabled) uci:set('fastd', 'mesh_vpn', 'enabled', vpn_config.enabled)
...@@ -45,4 +49,15 @@ else ...@@ -45,4 +49,15 @@ else
end end
uci:save('tunneldigger') 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') uci:save('simple-tc')
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