[6/6] alfred-monitoring-proxy: Improve curl call

Submitted by Adrian Schmutzler on Jan. 27, 2019, 4:38 p.m.

Details

Message ID 20190127163823.23382-7-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler Jan. 27, 2019, 4:38 p.m.
This improves the curl call by:
- Using full executable path
- Removing redundant -X POST
- Using --data-binary instead of --data

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 .../fff-alfred-monitoring-proxy/files/usr/sbin/alfred-monitoring-proxy  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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 b91187f6..d2c2f613 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
@@ -4,4 +4,4 @@  api_url="https://monitoring.freifunk-franken.de/api/alfred2"
 fetch_id="64"
 
 /bin/alfred-json -r "$fetch_id" | \
-    curl -k -v -H "Content-type: application/json; charset=UTF-8" -X POST --data "@-" $api_url
+    /usr/bin/curl -k -v -H "Content-type: application/json; charset=UTF-8" --data-binary @- "$api_url"

Comments

Christian Dresel Jan. 27, 2019, 4:59 p.m.
Wie bereits in der letzten Mail gesagt, mit dieser hier macht komm ich
dann auch mit :)

Reviewed-by: Christian Dresel <fff@chrisi01.de>

Gruß

Christian

On 27.01.19 17:38, Adrian Schmutzler wrote:
> This improves the curl call by:
> - Using full executable path
> - Removing redundant -X POST
> - Using --data-binary instead of --data
>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  .../fff-alfred-monitoring-proxy/files/usr/sbin/alfred-monitoring-proxy  | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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 b91187f6..d2c2f613 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
> @@ -4,4 +4,4 @@ api_url="https://monitoring.freifunk-franken.de/api/alfred2"
>  fetch_id="64"
>  
>  /bin/alfred-json -r "$fetch_id" | \
> -    curl -k -v -H "Content-type: application/json; charset=UTF-8" -X POST --data "@-" $api_url
> +    /usr/bin/curl -k -v -H "Content-type: application/json; charset=UTF-8" --data-binary @- "$api_url"
Fabian Blaese Jan. 27, 2019, 8:30 p.m.
Hallo,

On 27.01.19 17:38, Adrian Schmutzler wrote:
> This improves the curl call by:
> - Using full executable path
> - Removing redundant -X POST
Jo.

> - Using --data-binary instead of --data
Das kann ich nicht bewerten. Da kennst du dich wohl sehr viel besser aus als ich, wenn nicht url-encoded fürs Monitoring besser ist, dann

Reviewed-by: Fabian Bläse <fabian@blaese.de>

Fabian