diff options
Diffstat (limited to 'protocols/luci-proto-wireguard/root/usr/libexec')
-rwxr-xr-x | protocols/luci-proto-wireguard/root/usr/libexec/rpcd/luci.wireguard | 8 |
1 files changed, 8 insertions, 0 deletions
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) |