summaryrefslogtreecommitdiff
path: root/session-test.sh
blob: 4d767f1af5cc40c69aaaf6d275883d03c96f9dc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
. /usr/share/libubox/jshn.sh

json_load "$(ubus call session create)"
json_get_var sid sid


json_init
json_add_string sid "$sid"
json_add_array "objects"
json_add_array ""
json_add_string "" "session"
json_add_string "" "list"
json_close_array
json_close_array

ubus call session grant "$(json_dump)"

echo "Session: $sid"
wget -O- "http://localhost:8080/ubus/$sid/session/list"