blob: d4545277ab069ea01032f07cad7cf322389dffe8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/sh
. /usr/share/libubox/jshn.sh
case "$1" in
list)
json_init
json_add_object "generateKeyPair"
json_close_object
json_add_object "getPeers"
json_add_string "interface"
json_close_object
json_dump
;;
call)
case "$2" in
generateKeyPair)
json_load "$(yggdrasil -genconf -json)"
json_get_vars PublicKey PrivateKey
json_cleanup
json_init
json_add_object "keys"
json_add_string "priv" "$PrivateKey"
json_add_string "pub" "$PublicKey"
json_close_object
json_dump
;;
getPeers)
read -r input
json_load "$input"
json_get_vars interface
yggdrasilctl -endpoint="unix:///tmp/yggdrasil/${interface}.sock" -json getPeers
;;
esac
;;
esac
|