diff --git a/python/deploy.py b/python/deploy.py index c735659..ae3725b 100644 --- a/python/deploy.py +++ b/python/deploy.py @@ -218,18 +218,19 @@ def remove_node(name): # ─── Status ──────────────────────────────────────────────────────────── def show_status(): - # Check systemd for running instances if state is empty r = run("systemctl list-units 'wallarm-node@*' --no-legend 2>/dev/null") if not r.stdout.strip(): print("No nodes running.") return print("\n─── Node Status ───") for line in r.stdout.strip().split("\n"): + # Parse: "wallarm-node@srv1.service loaded active running ..." parts = line.split() - if len(parts) >= 4: - name = parts[0].replace("wallarm-node@", "").replace(".service", "") - status = "●" if parts[3] == "running" else "○" - print(f" {status} {name} — {parts[3]}") + if len(parts) >= 4 and '@' in parts[0]: + name = parts[0].split('@')[1].replace(".service", "") + active = parts[3] if len(parts) > 3 else "unknown" + status = "●" if active == "active" or active == "running" else "○" + print(f" {status} {name} — {active}") # ─── Tunnel ────────────────────────────────────────────────────────────