diff --git a/debian/changelog b/debian/changelog index c14c563..659479f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wb-utils (4.23.1) stable; urgency=medium + + * wb-watch-update: republish retained messages on reconnect to mqtt broker + + -- Nikolay Korotkiy Wed, 25 Sep 2024 17:30:00 +0400 + wb-utils (4.23.0) stable; urgency=medium * wb-prepare: run scripts from /etc/wb-prepare.d on firstboot diff --git a/utils/bin/wb-watch-update b/utils/bin/wb-watch-update index 045a473..db0d681 100755 --- a/utils/bin/wb-watch-update +++ b/utils/bin/wb-watch-update @@ -149,6 +149,13 @@ chown www-data:www-data "$SINGLE_WATCH_DIR" LAST_FIT='' +mosquitto_sub -t '$SYS/broker/uptime' | while read -r message; do + if [[ "$message" == "0 seconds" ]]; then + publish_factoryreset_fits_info + mqtt_status "IDLE" + fi +done & + ( echo "$BASHPID" > "$PID_FILE" 2>/dev/null exec inotifywait -m -r \