From c6031f458ffadf289e7f7b3ef311b2fdfad34c4b Mon Sep 17 00:00:00 2001 From: Toby Date: Wed, 20 Sep 2023 01:05:24 +0200 Subject: [PATCH] fix output --- monitor2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/monitor2.py b/monitor2.py index 3d0797f..4756690 100755 --- a/monitor2.py +++ b/monitor2.py @@ -143,11 +143,12 @@ def main(): if end: break + states = [] for host in hosts: - if host.is_alive(): - break + states.append(not host.is_alive()) + + if all(states): end = True - break time.sleep(0.1)