mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-27 17:45:15 +01:00
First draft of the pub/sub notifier
This commit is contained in:
@@ -237,9 +237,12 @@ curl_callback() {
|
||||
local data=${2}
|
||||
local returncode
|
||||
|
||||
trace "[curl_callback] curl -w \"%{http_code}\" -H \"Content-Type: application/json\" -H \"X-Forwarded-Proto: https\" -d \"${data}\" ${url}"
|
||||
rc=$(curl -w "%{http_code}" -H "Content-Type: application/json" -H "X-Forwarded-Proto: https" -d "${data}" ${url})
|
||||
returncode=$?
|
||||
#trace "[curl_callback] curl -w \"%{http_code}\" -H \"Content-Type: application/json\" -H \"X-Forwarded-Proto: https\" -d \"${data}\" ${url}"
|
||||
#rc=$(curl -w "%{http_code}" -H "Content-Type: application/json" -H "X-Forwarded-Proto: https" -d "${data}" ${url})
|
||||
#returncode=$?
|
||||
trace "[curl_callback] mosquitto_rr -h broker -t notifier -e jefsio -m \"{\"response-topic\":\"jefsio\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${data}\"}\""
|
||||
rc=$(./mosquitto_rr -h broker -t notifier -e jefsio -m "{\"response-topic\":\"jefsio\",\"cmd\":\"web\",\"url\":\"${url}\",\"body\":\"${data}\"}")
|
||||
rc=$(echo "${rc}" | jq ".http_code")
|
||||
trace "[curl_callback] HTTP return code=${rc}"
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
@@ -202,9 +202,12 @@ serve_ots_backoffice() {
|
||||
trace "[serve_ots_backoffice] url=${url}"
|
||||
|
||||
# Call back newly upgraded stamps
|
||||
trace "[serve_ots_backoffice] curl -s -o /dev/null -w \"%{http_code}\" -H \"X-Forwarded-Proto: https\" ${url}"
|
||||
rc=$(curl -s -o /dev/null -w "%{http_code}" -H "X-Forwarded-Proto: https" ${url})
|
||||
returncode=$?
|
||||
#trace "[serve_ots_backoffice] curl -s -o /dev/null -w \"%{http_code}\" -H \"X-Forwarded-Proto: https\" ${url}"
|
||||
#rc=$(curl -s -o /dev/null -w "%{http_code}" -H "X-Forwarded-Proto: https" ${url})
|
||||
#returncode=$?
|
||||
trace "[serve_ots_backoffice] mosquitto_rr -h broker -t notifier -e dhtsggs -m \"{\"response-topic\":\"dhtsggs\",\"cmd\":\"web\",\"url\":\"${url}\"}\""
|
||||
rc=$(./mosquitto_rr -h broker -t notifier -e dhtsggs -m "{\"response-topic\":\"dhtsggs\",\"cmd\":\"web\",\"url\":\"${url}\"}")
|
||||
rc=$(echo "${rc}" | jq ".http_code")
|
||||
trace_rc ${returncode}
|
||||
|
||||
# Even if curl executed ok, we need to make sure the http return code is also ok
|
||||
|
||||
Reference in New Issue
Block a user