summaryrefslogtreecommitdiffstats
path: root/scripts/afm-util
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-11-16 17:38:26 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-24 17:44:57 +0100
commitb5c95cf683a396f1b8dbd0f3edd093f2f1edf838 (patch)
tree67eafbe5954085fa0f44128de36096b6ec9b0c46 /scripts/afm-util
parent971d4e96d6b14c01e8eae4f6e9910bc5859adfb1 (diff)
afm-util/install: use of web socket connection
Change-Id: I8bda689a377d676c4b190e1b54cdc115006c9829 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'scripts/afm-util')
-rwxr-xr-xscripts/afm-util30
1 files changed, 2 insertions, 28 deletions
diff --git a/scripts/afm-util b/scripts/afm-util
index bbab51b..4d86218 100755
--- a/scripts/afm-util
+++ b/scripts/afm-util
@@ -1,34 +1,8 @@
#!/bin/bash
-if [ "x" = "x${DBUS_SESSION_BUS_ADDRESS}" ]; then
- DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
-fi
-export DBUS_SESSION_BUS_ADDRESS
-
-pretty() {
- sed ' /^method return .*/d
- s/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/
- s/^ string "\(.*\)"/\1/
- s:[[{,]:&\n:g
- s: *[]}]:\n&:g
- ' |
- sed ' s:^ *::
- s: *$::
- /[]}],*$/ {x;s:...::;x}
- G
- /[[{]\n/ {x;s:$: :;x}
- s:^\(.*[^\n]\)\n\( *\)$:\2\1:
- '
-}
-
send() {
- dbus-send --session --print-reply \
- --dest=org.AGL.afm.user \
- /org/AGL/afm/user \
- org.AGL.afm.user.$1 \
- "string:$2" |
- pretty
- return ${PIPESTATUS[0]}
+ afb-client-demo -H -d unix:/run/afm/apis/ws/afm-main "$1" "$2" |
+ awk '$1=="ON-REPLY-FAIL"{$1="ERROR:";$2="";print;exit 1;}NR>1'
}
case "$1" in