mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-04 23:45:37 -04:00
Improved rnstatus output
This commit is contained in:
parent
5606b64317
commit
b3a439993d
2 changed files with 15 additions and 6 deletions
|
@ -49,18 +49,19 @@ def size_str(num, suffix='B'):
|
|||
def program_setup(configdir, dispall=False, verbosity = 0):
|
||||
reticulum = RNS.Reticulum(configdir = configdir, loglevel = 3+verbosity)
|
||||
|
||||
ifstats = None
|
||||
stats = None
|
||||
try:
|
||||
ifstats = reticulum.get_interface_stats()
|
||||
stats = reticulum.get_interface_stats()
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
if ifstats != None:
|
||||
for ifstat in ifstats:
|
||||
if stats != None:
|
||||
for ifstat in stats["interfaces"]:
|
||||
name = ifstat["name"]
|
||||
|
||||
if dispall or not (name.startswith("LocalInterface[") or name.startswith("TCPInterface[Client")):
|
||||
print("")
|
||||
|
||||
if ifstat["status"]:
|
||||
ss = "Up"
|
||||
else:
|
||||
|
@ -117,6 +118,9 @@ 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 Transport Instance "+RNS.prettyhexrep(stats["transport_id"])+" running")
|
||||
|
||||
print("")
|
||||
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue