First draft of the pub/sub notifier

This commit is contained in:
kexkey
2019-05-17 18:29:06 -04:00
committed by kexkey
parent 2c3b28bc84
commit ed71a2ed8f
13 changed files with 231 additions and 19 deletions

View File

@@ -0,0 +1,22 @@
#!/bin/sh
. ./trace.sh
publish_response() {
trace "Entering publish_response()..."
local response=${1}
local response_topic=${2}
local returncode=${3}
trace "[publish_response] response=${response}"
trace "[publish_response] response_topic=${response_topic}"
trace "[publish_response] returncode=${returncode}"
trace "[publish_response] mosquitto_pub -h broker -t \"${response_topic}\" -m \"${response}\""
mosquitto_pub -h broker -t "${response_topic}" -m "${response}"
returncode=$?
trace_rc ${returncode}
return ${returncode}
}