From 78ca654c5cd394fcd1fdbb27bd7a3b2eb4ce1432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 12 Jan 2022 01:35:02 +0100 Subject: [PATCH] gluon-mesh-vpn-fastd: fix empty string key Co-Authored-By: Matthias Schiffer --- .../luasrc/usr/lib/lua/gluon/mesh-vpn/provider/fastd.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/gluon-mesh-vpn-fastd/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/fastd.lua b/package/gluon-mesh-vpn-fastd/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/fastd.lua index 1d628dc7..bcc6b5e1 100644 --- a/package/gluon-mesh-vpn-fastd/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/fastd.lua +++ b/package/gluon-mesh-vpn-fastd/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/fastd.lua @@ -7,7 +7,13 @@ local vpn_core = require 'gluon.mesh-vpn' local M = {} 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 function M.enable(val)