fix(watchdogs): Tailscale false positive + system watchdog banner
network_watchdog: Tailscale JSON uses "BackendState": "Running" (with space) but grep pattern matched "BackendState":"Running" (no space) — always failed. Switched to grep -qE with \s* to handle both forms. system_watchdog: add echo banner at run start so its output is visually separated from docker_watchdog in orchestrator logs. Previously appeared as a continuation of the docker section since docker_watchdog has a banner but system_watchdog did not.
This commit is contained in:
@@ -173,7 +173,7 @@ if [[ "$SHOW_STATUS" == true ]]; then
|
||||
fi
|
||||
|
||||
if [[ "${NETWORK_WATCHDOG_CHECK_TAILSCALE:-true}" == "true" ]] && command -v tailscale >/dev/null 2>&1; then
|
||||
if tailscale status --json 2>/dev/null | grep -q '"BackendState":"Running"'; then
|
||||
if tailscale status --json 2>/dev/null | grep -qE '"BackendState":\s*"Running"'; then
|
||||
echo " $ICON_SUCCESS Tailscale: running"
|
||||
else
|
||||
echo " $ICON_ERROR Tailscale: NOT running"
|
||||
@@ -254,7 +254,7 @@ fi
|
||||
if [[ "${NETWORK_WATCHDOG_CHECK_TAILSCALE:-true}" == "true" ]]; then
|
||||
if ! command -v tailscale >/dev/null 2>&1; then
|
||||
log "Tailscale not installed — skipping"
|
||||
elif tailscale status --json 2>/dev/null | grep -q '"BackendState":"Running"'; then
|
||||
elif tailscale status --json 2>/dev/null | grep -qE '"BackendState":\s*"Running"'; then
|
||||
log "$ICON_SUCCESS Tailscale running"
|
||||
else
|
||||
warn "$ICON_ERROR Tailscale not in Running state"
|
||||
|
||||
@@ -84,6 +84,8 @@ fi
|
||||
# ==============================================================================================
|
||||
# ━━━ Run Sequence ━━━
|
||||
# ==============================================================================================
|
||||
echo "━━━ $ICON_SHIELD System Watchdog — $(date '+%Y-%m-%d %H:%M:%S') ━━━"
|
||||
|
||||
START=$(date +%s)
|
||||
PASSED=()
|
||||
FAILED=()
|
||||
|
||||
Reference in New Issue
Block a user