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) },
|
{ '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'
|
|||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user