From dc43b9844b7ba0bbe41fae381332eccd66adc44e Mon Sep 17 00:00:00 2001 From: FailedProxy Date: Sun, 26 Apr 2026 02:44:59 -0400 Subject: [PATCH] quick update to watchdogs --- Docker_Essentials/docker_watchdog.sh | 10 +++++----- unRAID_Essentials/system_watchdog.sh | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Docker_Essentials/docker_watchdog.sh b/Docker_Essentials/docker_watchdog.sh index 99ec46d..f529a1e 100644 --- a/Docker_Essentials/docker_watchdog.sh +++ b/Docker_Essentials/docker_watchdog.sh @@ -567,11 +567,11 @@ while [[ "$WATCHDOG_RUNNING" == true ]]; do log "Cycle $CYCLE — all healthy ($(date '+%H:%M:%S'))" # Heartbeat — periodic proof of life if [[ "${DOCKER_WATCHDOG_HEARTBEAT:-true}" == true ]]; then - local hb_seconds=$(( ${DOCKER_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 )) - local uptime_seconds=$(( CYCLE * DOCKER_WATCHDOG_INTERVAL )) - if (( uptime_seconds % hb_seconds < DOCKER_WATCHDOG_INTERVAL )); then - local uptime_hr=$(( uptime_seconds / 3600 )) - info "♥ docker_watchdog alive — ~${uptime_hr}hr uptime ($(date '+%H:%M:%S'))" + HB_SECONDS=$(( ${DOCKER_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 )) + UPTIME_SECONDS=$(( CYCLE * DOCKER_WATCHDOG_INTERVAL )) + if [[ "$HB_SECONDS" -gt 0 ]] && (( UPTIME_SECONDS % HB_SECONDS < DOCKER_WATCHDOG_INTERVAL )) && [[ "$UPTIME_SECONDS" -gt 0 ]]; then + HB_UPTIME_HR=$(( UPTIME_SECONDS / 3600 )) + info "♥ docker_watchdog alive — ~${HB_UPTIME_HR}hr uptime ($(date '+%H:%M:%S'))" fi fi fi diff --git a/unRAID_Essentials/system_watchdog.sh b/unRAID_Essentials/system_watchdog.sh index 153b8b5..d05810f 100644 --- a/unRAID_Essentials/system_watchdog.sh +++ b/unRAID_Essentials/system_watchdog.sh @@ -429,11 +429,11 @@ while [[ "$WATCHDOG_RUNNING" == true ]]; do log "Cycle $CYCLE — system healthy ($(date '+%H:%M:%S'))" # Heartbeat — periodic proof of life if [[ "${SYSTEM_WATCHDOG_HEARTBEAT:-true}" == true ]]; then - local hb_seconds=$(( ${SYSTEM_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 )) - local uptime_seconds=$(( CYCLE * SYSTEM_WATCHDOG_INTERVAL )) - if (( uptime_seconds % hb_seconds < SYSTEM_WATCHDOG_INTERVAL )); then - local uptime_hr=$(( uptime_seconds / 3600 )) - info "♥ system_watchdog alive — ~${uptime_hr}hr uptime ($(date '+%H:%M:%S'))" + HB_SECONDS=$(( ${SYSTEM_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 )) + UPTIME_SECONDS=$(( CYCLE * SYSTEM_WATCHDOG_INTERVAL )) + if [[ "$HB_SECONDS" -gt 0 ]] && (( UPTIME_SECONDS % HB_SECONDS < SYSTEM_WATCHDOG_INTERVAL )) && [[ "$UPTIME_SECONDS" -gt 0 ]]; then + HB_UPTIME_HR=$(( UPTIME_SECONDS / 3600 )) + info "♥ system_watchdog alive — ~${HB_UPTIME_HR}hr uptime ($(date '+%H:%M:%S'))" fi fi fi