From fe4136167ab55977935a9b09d33cede4ae5a5f4a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 23 Aug 2018 22:47:16 +0200 Subject: [PATCH] sendgwinfo: Multi-URL, https and default batctl (v1.3) Signed-off-by: Adrian Schmutzler --- gwinfo/sendgwinfo.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gwinfo/sendgwinfo.sh b/gwinfo/sendgwinfo.sh index 3c43557..fcf9fbe 100755 --- a/gwinfo/sendgwinfo.sh +++ b/gwinfo/sendgwinfo.sh @@ -4,6 +4,11 @@ # Copyright Adrian Schmutzler, 2018. # License GPLv3 # +# v1.3 - 2018-08-23 +# - Support multiple Monitoring URLs +# - Use https by default +# - Changed batctl default path +# # v1.2.1 - 2018-01-12 # - Added "grep fff" to support L2TP # @@ -15,9 +20,8 @@ # # Config -#api_url="http://192.168.1.84/api/gwinfo" -api_url="http://monitoring.freifunk-franken.de/api/gwinfo" -batctlpath=/usr/local/sbin/batctl # Adjust to YOUR path! +api_urls="https://monitoring.freifunk-franken.de/api/gwinfo" # space-separated list of addresses (api_urls="url1 url2") +batctlpath=/usr/sbin/batctl # Adjust to YOUR path! hostname="MyHost" admin1="Admin" admin2= @@ -48,5 +52,7 @@ comma="" echo "]}" >> $tmp -/usr/bin/curl -k -v -H "Content-type: application/json; charset=UTF-8" -X POST --data-binary @$tmp $api_url +for api_url in $api_urls; do + /usr/bin/curl -k -v -H "Content-type: application/json; charset=UTF-8" -X POST --data-binary @$tmp $api_url +done /bin/rm "$tmp"