changed topic and also added the -q 0 flag to mosquitto_sub
This commit is contained in:
@@ -65,7 +65,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 5. Wait for response from daemon
|
# 5. Wait for response from daemon
|
||||||
mosquitto_sub -h 127.0.0.1 -p 1883 -t "$TOPIC" | while IFS="=" read -r key value
|
mosquitto_sub -h 127.0.0.1 -p 1883 -q 0 -t "$TOPIC" | while IFS="=" read -r key value
|
||||||
do
|
do
|
||||||
case "$key" in
|
case "$key" in
|
||||||
"SaveSync") call_exit "$value";;
|
"SaveSync") call_exit "$value";;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
touch "$LOG_FILE"
|
touch "$LOG_FILE"
|
||||||
|
|
||||||
mosquitto_pub -h 127.0.0.1 -p 1883 -t "$TOPIC" "SaveLogStart=1"
|
mosquitto_pub -h 127.0.0.1 -p 1883 -t "$TOPIC" "SaveLogStart=1"
|
||||||
mosquitto_sub -h 127.0.0.1 -p 1883 -t "$TOPIC" | while IFS="=" read -r key value
|
mosquitto_sub -h 127.0.0.1 -p 1883 -q 0 -t "$TOPIC" | while IFS="=" read -r key value
|
||||||
do
|
do
|
||||||
case "$key" in
|
case "$key" in
|
||||||
"SaveLog") printf "%s\n" "$value" >> "$LOG_FILE" ;;
|
"SaveLog") printf "%s\n" "$value" >>"$LOG_FILE" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ log() {
|
|||||||
log "INFO" "--- ES Event Daemon Started ---"
|
log "INFO" "--- ES Event Daemon Started ---"
|
||||||
|
|
||||||
# --- Main Listener Loop ---
|
# --- Main Listener Loop ---
|
||||||
mosquitto_sub -h 127.0.0.1 -p 1883 -t "$TOPIC" | while IFS="=" read -r key value
|
mosquitto_sub -h 127.0.0.1 -p 1883 -q 0 -t "$TOPIC" | while IFS="=" read -r key value
|
||||||
do
|
do
|
||||||
# 1. Clean Carriage Returns from Windows-style line endings
|
# 1. Clean Carriage Returns from Windows-style line endings
|
||||||
value=$(echo "$value" | tr -d '\r')
|
value=$(echo "$value" | tr -d '\r')
|
||||||
|
|||||||
Reference in New Issue
Block a user