summaryrefslogtreecommitdiff
path: root/session-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'session-test.sh')
-rwxr-xr-xsession-test.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/session-test.sh b/session-test.sh
new file mode 100755
index 0000000..4d767f1
--- /dev/null
+++ b/session-test.sh
@@ -0,0 +1,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"