Skip to content
Snippets Groups Projects
Unverified Commit a8d6a99f authored by Maciej Krüger's avatar Maciej Krüger
Browse files

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

parent 78ca654c
No related branches found
No related tags found
No related merge requests found
...@@ -22,8 +22,8 @@ local values = { ...@@ -22,8 +22,8 @@ local values = {
{ 'Hostname', pretty_hostname.get(uci) }, { 'Hostname', pretty_hostname.get(uci) },
{ 'MAC address', sysconfig.primary_mac }, { 'MAC address', sysconfig.primary_mac },
{ 'Hardware model', platform.get_model() }, { 'Hardware model', platform.get_model() },
{ 'Gluon version' .. " / " .. 'Site version', util.trim(util.readfile('/lib/gluon/gluon-version')) { 'Gluon version / Site version', util.trim(util.readfile('/lib/gluon/gluon-version'))
.. " / " .. util.trim(util.readfile('/lib/gluon/site-version')) }, .. ' / ' .. util.trim(util.readfile('/lib/gluon/site-version')) },
{ 'Firmware release', util.trim(util.readfile('/lib/gluon/release')) }, { 'Firmware release', util.trim(util.readfile('/lib/gluon/release')) },
{ 'Site', site.site_name() }, { 'Site', site.site_name() },
{ 'Public VPN key', pubkey or 'n/a' }, { 'Public VPN key', pubkey or 'n/a' },
......
...@@ -7,7 +7,13 @@ local vpn_core = require 'gluon.mesh-vpn' ...@@ -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("/lib/gluon/mesh-vpn/wireguard_pubkey.sh")) local key = util.trim(util.exec("/lib/gluon/mesh-vpn/wireguard_pubkey.sh"))
if key == '' then
key = nil
end
return key
end end
function M.enable(val) function M.enable(val)
......
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