gluon-mesh-vpn-core: staticaly return 'mesh-vpn' and change lib name

This commit is contained in:
Jan-Tarek Butt 2018-08-24 23:17:33 +02:00
parent 228cdef358
commit 5f8ba24fa7
2 changed files with 7 additions and 24 deletions

View File

@ -0,0 +1,7 @@
local M = {}
function M.get_mesh_vpn_interface()
return 'mesh-vpn'
end
return M

View File

@ -1,24 +0,0 @@
local uci = require('simple-uci').cursor()
local unistd = require 'posix.unistd'
local M = {}
function M.get_mesh_vpn_interface()
local ret = {}
if unistd.access('/lib/gluon/mesh-vpn/fastd') then
local vpnifac = uci:get('fastd', 'mesh_vpn_backbone', 'net')
if vpnifac ~= nil then
vpnifac = vpnifac:gsub("%_",'-')
table.insert(ret,vpnifac)
end
end
if unistd.access('/lib/gluon/mesh-vpn/tunneldigger') then
local vpnifac = uci:get('tunneldigger', 'mesh_vpn', 'interface')
if vpnifac ~= nil then
table.insert(ret,vpnifac)
end
end
return ret
end
return M