Update client.py

This commit is contained in:
Aryan Singh committed 2026-09-12 20:51:46 -05:00
1 parent 1771235d61
commit b606caa688
1 file changed
+13 -11
+13 -11
View File
@@ -68,15 +68,17 @@ def grep_all_ips(ips, cmd):
return match_count
while True:
cmd = input(">> ").strip()
match_count = grep_all_ips(ALL_IPS, cmd)
#get all the argument of call
import sys
print("=========================== SUMMARY ===========================")
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"Total matches: {max(0, sum(match_count))}")
print("===============================================================")
cmd = " ".join(sys.argv[1:])
match_count = grep_all_ips(ALL_IPS, cmd)
print("=========================== SUMMARY ===========================")
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"Total matches: {max(0, sum(match_count))}")
print("===============================================================")