summaryrefslogtreecommitdiff
path: root/session-test.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-07 02:56:48 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-07 02:56:48 +0100
commitf8573c7b4c3a9e1a67cae787690f27a976aee11c (patch)
tree3c12caa8232012458026ed3d7b49fbe445877a3f /session-test.sh
parent11cbb4498b2da95ece2ad4ce940ca9cda8b479eb (diff)
add ubus support
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"