From a5cf3d1f8bf54a1a3bedbe560db64b38829b10c4 Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Sun, 19 Apr 2026 22:34:21 -0700 Subject: [PATCH] health-check.sh: only show docker and Syncthing checks on spokes, not hubs --- health-check.sh | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/health-check.sh b/health-check.sh index 62bb0e4..aa45500 100755 --- a/health-check.sh +++ b/health-check.sh @@ -36,18 +36,6 @@ fi check_common() { header "System" - if command -v docker >/dev/null 2>&1; then - ok "docker installed" - else - fail "docker not found" - fi - - if docker info >/dev/null 2>&1; then - ok "docker daemon running" - else - fail "docker daemon not running" - fi - local ssh_svc="" if systemctl list-unit-files ssh.service >/dev/null 2>&1; then ssh_svc="ssh" @@ -65,17 +53,31 @@ check_common() { warn "Could not detect SSH service" fi - local st_container - st_container=$(docker ps --format '{{.Names}}' 2>/dev/null | grep -i syncthing | head -1 || true) - if [ -n "$st_container" ]; then - ok "Syncthing container running ($st_container)" - if curl -sf http://127.0.0.1:8384 >/dev/null 2>&1; then - ok "Syncthing API reachable" + if [ "$IS_SPOKE" = true ]; then + if command -v docker >/dev/null 2>&1; then + ok "docker installed" else - warn "Syncthing container running but API not reachable on :8384" + fail "docker not found" + fi + + if docker info >/dev/null 2>&1; then + ok "docker daemon running" + else + fail "docker daemon not running" + fi + + local st_container + st_container=$(docker ps --format '{{.Names}}' 2>/dev/null | grep -i syncthing | head -1 || true) + if [ -n "$st_container" ]; then + ok "Syncthing container running ($st_container)" + if curl -sf http://127.0.0.1:8384 >/dev/null 2>&1; then + ok "Syncthing API reachable" + else + warn "Syncthing container running but API not reachable on :8384" + fi + else + warn "No Syncthing container running" fi - else - warn "No Syncthing container running" fi }