Skip to content

Commit 8cbb27d

Browse files
committed
0.2.198
mqtt error handling change
1 parent c68b576 commit 8cbb27d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
.DS_Store

monitor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# ----------------------------------------------------------------------------------------
2626

2727
#VERSION NUMBER
28-
export version=0.2.197
28+
export version=0.2.198
2929

3030
#COLOR OUTPUT FOR RICH OUTPUT
3131
ORANGE=$'\e[1;33m'

support/mqtt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ mqtt_error_handler () {
163163

164164
if [ -n "$received" ]; then
165165
#ERRORS
166-
[[ ${received^^} =~ .*REFUSED.* ]] && return_value=1 && print_message="mqtt broker refused connection - check username, password, and host address"
167-
[[ ${received^^} =~ .*NETWORK.* ]] && return_value=0 && print_message="network is down. enqueuing command to try again after a delay"
166+
[[ ${received^^} =~ .*NO ROUTE TO HOST.* ]] && return_value=1 && print_message="networking errors, no route to host - check username, password, and host address"
167+
[[ ${received^^} =~ .*CONNECTION REFUSED.* ]] && return_value=1 && print_message="mqtt broker refused connection - check username, password, and host address"
168+
[[ ${received^^} =~ .*NETWORK.* ]] && [[ ${received^^} =~ .*UNREACHABLE.* ]] && return_value=0 && print_message="network is down. enqueuing command to try again after a delay"
168169

169170
if [ -n "$last_error_message" ] && [ "$last_error_message" == "$print_message" ]; then
170171
#HERE, WE HAVE A REPEATED ERROR

0 commit comments

Comments
 (0)