From 8a9dbe39d5b5f3227f46868b3b15f7cc72a50651 Mon Sep 17 00:00:00 2001 From: Paul Dee Date: Thu, 11 Nov 2021 01:31:43 +0100 Subject: luci-proto-wireguard: display interface public key Signed-off-by: Paul Dee --- .../luci-proto-wireguard/root/usr/libexec/rpcd/luci.wireguard | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'protocols/luci-proto-wireguard/root/usr/libexec') diff --git a/protocols/luci-proto-wireguard/root/usr/libexec/rpcd/luci.wireguard b/protocols/luci-proto-wireguard/root/usr/libexec/rpcd/luci.wireguard index 681e98e5c4..bbe91cdd6a 100755 --- a/protocols/luci-proto-wireguard/root/usr/libexec/rpcd/luci.wireguard +++ b/protocols/luci-proto-wireguard/root/usr/libexec/rpcd/luci.wireguard @@ -16,6 +16,14 @@ local methods = { return {keys = {priv = prv, pub = pub}} end }, + getPublicAndPrivateKeyFromPrivate = { + args = {privkey = "privkey"}, + call = function(args) + local pubkey = sys.exec("echo %s | wg pubkey 2>/dev/null" % util.shellquote(args.privkey)):sub(1, -2) + + return {keys = {priv = args.privkey, pub = pubkey}} + end + }, generateQrCode = { args = {privkey = "privkey", psk = "psk", allowed_ips = {"allowed_ips"}}, call = function(args) -- cgit v1.2.3