aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
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
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')
-rw-r--r--scripts/CMakeLists.txt1
-rwxr-xr-x[-rw-r--r--]scripts/afm-debug0
l---------scripts/afm-install1
-rwxr-xr-xscripts/afm-util30
4 files changed, 4 insertions, 28 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index bf0846c..e0f80ac 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -20,6 +20,7 @@ cmake_minimum_required(VERSION 2.8)
if(NOT USE_SDK)
install(PROGRAMS afm-util DESTINATION ${CMAKE_INSTALL_BINDIR})
+ install(PROGRAMS afm-install DESTINATION ${CMAKE_INSTALL_BINDIR})
if(AGL_DEVEL)
install(PROGRAMS afm-debug DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
diff --git a/scripts/afm-debug b/scripts/afm-debug
index 18ecae2..18ecae2 100644..100755
--- a/scripts/afm-debug
+++ b/scripts/afm-debug
diff --git a/scripts/afm-install b/scripts/afm-install
new file mode 120000
index 0000000..5bde063
--- /dev/null
+++ b/scripts/afm-install
@@ -0,0 +1 @@
+afm-util \ No newline at end of file
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