gluon-mesh-vpn-fastd: fix empty string key

Co-Authored-By: Matthias Schiffer <mschiffer@universe-factory.net>
This commit is contained in:
Maciej Krüger 2022-01-12 01:35:02 +01:00
parent 08a8ef0bcd
commit 78ca654c5c
No known key found for this signature in database
GPG Key ID: 0D948CE19CF49C5F

View File

@ -7,7 +7,13 @@ local vpn_core = require 'gluon.mesh-vpn'
local M = {} local M = {}
function M.public_key() function M.public_key()
return util.trim(util.exec('/etc/init.d/fastd show_key mesh_vpn')) local key = util.trim(util.exec('/etc/init.d/fastd show_key mesh_vpn'))
if key == '' then
key = nil
end
return key
end end
function M.enable(val) function M.enable(val)