From 544e15afdf419c99d3ec14ae321ad9a4585155b3 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 24 Sep 2021 11:17:23 +0200 Subject: [PATCH] Added rnsd utility --- RNS/Utilities/rnsd.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 RNS/Utilities/rnsd.py diff --git a/RNS/Utilities/rnsd.py b/RNS/Utilities/rnsd.py new file mode 100644 index 0000000..a43beda --- /dev/null +++ b/RNS/Utilities/rnsd.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +import RNS +import argparse + +from RNS._version import __version__ + + +def program_setup(configdir): + reticulum = RNS.Reticulum(configdir = configdir) + RNS.log("Started rnsd version {version}".format(version=__version__), RNS.LOG_INFO) + while True: + input() + +def main(): + try: + parser = argparse.ArgumentParser(description="Nomad Network Client") + parser.add_argument("--config", action="store", default=None, help="path to alternative Reticulum config directory", type=str) + parser.add_argument("--version", action="version", version="rnsd {version}".format(version=__version__)) + + args = parser.parse_args() + + if args.config: + configarg = args.config + else: + configarg = None + + program_setup(configdir = configarg) + + except KeyboardInterrupt: + print("") + exit() + +if __name__ == "__main__": + main() \ No newline at end of file