forked from finn/tinyboard
health-check.sh: only show docker and Syncthing checks on spokes, not hubs
This commit is contained in:
@@ -36,18 +36,6 @@ fi
|
|||||||
check_common() {
|
check_common() {
|
||||||
header "System"
|
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=""
|
local ssh_svc=""
|
||||||
if systemctl list-unit-files ssh.service >/dev/null 2>&1; then
|
if systemctl list-unit-files ssh.service >/dev/null 2>&1; then
|
||||||
ssh_svc="ssh"
|
ssh_svc="ssh"
|
||||||
@@ -65,17 +53,31 @@ check_common() {
|
|||||||
warn "Could not detect SSH service"
|
warn "Could not detect SSH service"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local st_container
|
if [ "$IS_SPOKE" = true ]; then
|
||||||
st_container=$(docker ps --format '{{.Names}}' 2>/dev/null | grep -i syncthing | head -1 || true)
|
if command -v docker >/dev/null 2>&1; then
|
||||||
if [ -n "$st_container" ]; then
|
ok "docker installed"
|
||||||
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
|
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
|
fi
|
||||||
else
|
|
||||||
warn "No Syncthing container running"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user