From fc80dd26147394e1c3f368676bf1ab28f949d527 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 25 May 2022 14:21:04 +0200 Subject: [PATCH] Improved rnstatus output --- RNS/Utilities/rnstatus.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/RNS/Utilities/rnstatus.py b/RNS/Utilities/rnstatus.py index dae7a81..6c80f61 100644 --- a/RNS/Utilities/rnstatus.py +++ b/RNS/Utilities/rnstatus.py @@ -59,7 +59,7 @@ def program_setup(configdir, dispall=False, verbosity = 0): for ifstat in stats["interfaces"]: name = ifstat["name"] - if dispall or not (name.startswith("LocalInterface[") or name.startswith("TCPInterface[Client")): + if dispall or not (name.startswith("LocalInterface[") or name.startswith("TCPInterface[Client") or name.startswith("I2PInterfacePeer[Connected peer")): print("") if ifstat["status"]: @@ -91,6 +91,14 @@ def program_setup(configdir, dispall=False, verbosity = 0): spec_str = " programs" clients_string = "Serving : "+str(cnum)+spec_str + elif name.startswith("I2PInterface["): + cnum = max(clients-1,0) + if cnum == 1: + spec_str = " connected I2P endpoint" + else: + spec_str = " connected I2P endpoints" + + clients_string = "Peers : "+str(cnum)+spec_str else: clients_string = "Clients : "+str(clients) @@ -133,7 +141,7 @@ def program_setup(configdir, dispall=False, verbosity = 0): print(" Traffic : {txb}↑\n {rxb}↓".format(rxb=size_str(ifstat["rxb"]), txb=size_str(ifstat["txb"]))) if "transport_id" in stats and stats["transport_id"] != None: - print("\n Reticulum Transport Instance "+RNS.prettyhexrep(stats["transport_id"])+" running") + print("\n Reticulum Transport Instance "+RNS.prettyhexrep(stats["transport_id"])+" is running") print("")