From patchwork Sun Jan 27 16:38:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [5/6] alfred-monitoring-proxy: Switch to alfred2 From: Adrian Schmutzler X-Patchwork-Id: 987 Message-Id: <20190127163823.23382-6-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Sun, 27 Jan 2019 17:38:22 +0100 By using the alfred2 mechanism of the Monitoring, we get rid of the embracing {"64":...} key-value construct. Signed-off-by: Adrian Schmutzler Reviewed-by: Christian Dresel Reviewed-by: Fabian Bläse --- src/packages/fff/fff-alfred-monitoring-proxy/Makefile | 2 +- .../files/usr/sbin/alfred-monitoring-proxy | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/packages/fff/fff-alfred-monitoring-proxy/Makefile b/src/packages/fff/fff-alfred-monitoring-proxy/Makefile index 7ebc2ee0..4370bd9c 100644 --- a/src/packages/fff/fff-alfred-monitoring-proxy/Makefile +++ b/src/packages/fff/fff-alfred-monitoring-proxy/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-alfred-monitoring-proxy PKG_VERSION:=0.0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/src/packages/fff/fff-alfred-monitoring-proxy/files/usr/sbin/alfred-monitoring-proxy b/src/packages/fff/fff-alfred-monitoring-proxy/files/usr/sbin/alfred-monitoring-proxy index c35e7f97..b91187f6 100755 --- a/src/packages/fff/fff-alfred-monitoring-proxy/files/usr/sbin/alfred-monitoring-proxy +++ b/src/packages/fff/fff-alfred-monitoring-proxy/files/usr/sbin/alfred-monitoring-proxy @@ -1,7 +1,7 @@ #!/bin/ash -api_url="https://monitoring.freifunk-franken.de/api/alfred" +api_url="https://monitoring.freifunk-franken.de/api/alfred2" fetch_id="64" -(echo -n "{\"$fetch_id\": "; alfred-json -r "$fetch_id"; echo -n "}") | \ +/bin/alfred-json -r "$fetch_id" | \ curl -k -v -H "Content-type: application/json; charset=UTF-8" -X POST --data "@-" $api_url