From 43026de8f252ef136bafab53701ac24f9697c308 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Fri, 28 Feb 2020 14:06:12 -0800 Subject: [PATCH] ws-sta-monitor: added --host argument --- py-json/ws-sta-monitor.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/py-json/ws-sta-monitor.py b/py-json/ws-sta-monitor.py index 2d775d28..aa2d8858 100755 --- a/py-json/ws-sta-monitor.py +++ b/py-json/ws-sta-monitor.py @@ -63,6 +63,21 @@ def main(): global websock host = "localhost" base_url = "ws://%s:8081"%host + resource_id = 1 # typically you're using resource 1 in stand alone realm + + parser = argparse.ArgumentParser(description="test creating a station") + parser.add_argument("-m", "--host", type=str, help="json host to connect to") + + args = None + try: + args = parser.parse_args() + if (args.host is not None): + host = args.host, + baseurl = base_url = "ws://%s:8081"%host + except Exception as e: + logging.exception(e) + usage() + exit(2) # open websocket websock = start_websocket(base_url, websock)