gluon-mesh-vpn-wireguard: fix empty string key
Co-Authored-By: Matthias Schiffer <mschiffer@universe-factory.net>
This commit is contained in:
parent
78ca654c5c
commit
a8d6a99f5b
@ -22,8 +22,8 @@ local values = {
|
||||
{ 'Hostname', pretty_hostname.get(uci) },
|
||||
{ 'MAC address', sysconfig.primary_mac },
|
||||
{ 'Hardware model', platform.get_model() },
|
||||
{ 'Gluon version' .. " / " .. 'Site version', util.trim(util.readfile('/lib/gluon/gluon-version'))
|
||||
.. " / " .. util.trim(util.readfile('/lib/gluon/site-version')) },
|
||||
{ 'Gluon version / Site version', util.trim(util.readfile('/lib/gluon/gluon-version'))
|
||||
.. ' / ' .. util.trim(util.readfile('/lib/gluon/site-version')) },
|
||||
{ 'Firmware release', util.trim(util.readfile('/lib/gluon/release')) },
|
||||
{ 'Site', site.site_name() },
|
||||
{ 'Public VPN key', pubkey or 'n/a' },
|
||||
|
@ -7,7 +7,13 @@ local vpn_core = require 'gluon.mesh-vpn'
|
||||
local M = {}
|
||||
|
||||
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
|
||||
|
||||
function M.enable(val)
|
||||
|
Loading…
Reference in New Issue
Block a user