Skip to content

Commit

Permalink
Only attempt to get RNS status if a shared instance already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Nov 22, 2024
1 parent f095b9c commit ea3ad6b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions RNS/Utilities/rnstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,18 @@ def remote_link_established(link):
def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=False, astats=False,
lstats=False, sorting=None, sort_reverse=False, remote=None, management_identity=None,
remote_timeout=RNS.Transport.PATH_REQUEST_TIMEOUT):
reticulum = RNS.Reticulum(configdir = configdir, loglevel = 3+verbosity)

if remote:
require_shared = False
else:
require_shared = True

try:
reticulum = RNS.Reticulum(configdir=configdir, loglevel=3+verbosity, require_shared_instance=require_shared)

except Exception as e:
print("No shared RNS instance available to get status from")
exit(1)

link_count = None
stats = None
Expand Down Expand Up @@ -364,7 +375,7 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
print("Could not get RNS status")
else:
print("Could not get RNS status from remote transport instance "+RNS.prettyhexrep(identity_hash))
exit(1)
exit(2)

def main():
try:
Expand Down

0 comments on commit ea3ad6b

Please sign in to comment.