Update client.py
This commit is contained in:
1 parent
1771235d61
commit
b606caa688
1 file changed
+9
-7
+9
-7
@@ -68,15 +68,17 @@ def grep_all_ips(ips, cmd):
|
|||||||
|
|
||||||
return match_count
|
return match_count
|
||||||
|
|
||||||
while True:
|
#get all the argument of call
|
||||||
cmd = input(">> ").strip()
|
import sys
|
||||||
match_count = grep_all_ips(ALL_IPS, cmd)
|
|
||||||
|
|
||||||
print("=========================== SUMMARY ===========================")
|
cmd = " ".join(sys.argv[1:])
|
||||||
for i, count in enumerate(match_count):
|
match_count = grep_all_ips(ALL_IPS, cmd)
|
||||||
|
|
||||||
|
print("=========================== SUMMARY ===========================")
|
||||||
|
for i, count in enumerate(match_count):
|
||||||
if count == -1:
|
if count == -1:
|
||||||
print(f"machine.{i + 1}.log: Connection failed")
|
print(f"machine.{i + 1}.log: Connection failed")
|
||||||
else:
|
else:
|
||||||
print(f"machine.{i + 1}.log: {count} matches")
|
print(f"machine.{i + 1}.log: {count} matches")
|
||||||
print(f"Total matches: {max(0, sum(match_count))}")
|
print(f"Total matches: {max(0, sum(match_count))}")
|
||||||
print("===============================================================")
|
print("===============================================================")
|
||||||
Reference in new issue
Block a user