Update client.py

This commit is contained in:
Aryan Singh committed 2026-09-12 20:48:10 -05:00
1 parent 76cc910260
commit 14a6ac78fc
1 file changed
+4 -1
+4 -1
View File
@@ -62,7 +62,7 @@ def grep_all_ips(ips, cmd):
except Exception as e: except Exception as e:
print(f"Failed to connect to {ip}:{PORT} - {e}") print(f"Failed to connect to {ip}:{PORT} - {e}")
match_count.append(0) match_count.append(-1)
finally: finally:
client_socket.close() client_socket.close()
@@ -74,6 +74,9 @@ while True:
print("=========================== SUMMARY ===========================") print("=========================== SUMMARY ===========================")
for i, count in enumerate(match_count): for i, count in enumerate(match_count):
if count == -1:
print(f"machine.{i + 1}.log: Connection failed")
else:
print(f"machine.{i + 1}.log: {count} matches") print(f"machine.{i + 1}.log: {count} matches")
print(f"Total matches: {sum(match_count)}") print(f"Total matches: {sum(match_count)}")
print("===============================================================") print("===============================================================")