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

gluon-mesh-vpn-core: add code for migration of enabled state between fastd and tunneldigger


Based-on-patch-by: default avatarCyrus Fox <cyrus@lambdacore.de>
parent a49ef70c
No related branches found
No related tags found
No related merge requests found
......@@ -58,3 +58,19 @@ uci:section('firewall', 'include', 'mesh_vpn_dns', {
})
uci:save('firewall')
-- VPN migration
local has_fastd = fs.access('/lib/gluon/mesh-vpn/fastd')
local fastd_enabled = has_fastd and uci:get_bool("fastd", "mesh_vpn", "enabled")
local has_tunneldigger = fs.access('/lib/gluon/mesh-vpn/tunneldigger')
local tunneldigger_enabled = has_fastd and uci:get_bool("tunneldigger", "mesh_vpn", "enabled")
local enabled = fastd_enabled or tunneldigger_enabled or false
uci:set("fastd", "mesh_vpn", "enabled", has_fastd and enabled)
uci:save("fastd")
uci:set("tunneldigger", "mesh_vpn", "enabled", has_tunneldigger and enabled)
uci:save("tunneldigger")
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