Signed-off-by: Wojciech Jowsa <wojciech.jowsa@gmail.com> [minor indentation fix, use bound section_id value, remove empty translation] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
26 lines
407 B
Bash
Executable file
26 lines
407 B
Bash
Executable file
#!/bin/sh
|
|
|
|
. /usr/share/libubox/jshn.sh
|
|
|
|
case "$1" in
|
|
list)
|
|
json_init
|
|
json_add_object "generateKeyPair"
|
|
json_close_object
|
|
json_dump
|
|
;;
|
|
call)
|
|
case "$2" in
|
|
generateKeyPair)
|
|
prv=$(wg genkey)
|
|
pub=$(echo $prv | wg pubkey)
|
|
json_init
|
|
json_add_object "keys"
|
|
json_add_string "priv" "$prv"
|
|
json_add_string "pub" "$pub"
|
|
json_close_object
|
|
json_dump
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|