From 5ca77e747944b0e88985172f5a7f3cd224cf63d1 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Thu, 4 Mar 2021 20:12:46 +0100 Subject: [PATCH] =?UTF-8?q?Statusabfrage=20der=20von=20diesem=20Ger=C3=A4t?= =?UTF-8?q?=20gesendeten=20Faxe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- status.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 status.sh diff --git a/status.sh b/status.sh new file mode 100755 index 0000000..88604d3 --- /dev/null +++ b/status.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +. $(dirname $(realpath $0))/authorization.sh +while read LINE; +do + JSON=$(curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" "https://api.sipgate.com/v2/history/$LINE" -s) + STATUS=$(echo $JSON | jq '.faxStatusType' | sed -e 's:"::g' ) + DATE=$(echo $JSON | jq '.created' | sed -e 's:"::g' ) + TARGET=$(echo $JSON | jq '.target' | sed -e 's:"::g' ) + echo "Fax $LINE vom $(date +%d.%m.%Y -d $DATE) an $TARGET: $STATUS" +done < .fax_history