From 42a63716e2bbf77647f400d841996e5d260f36d5 Mon Sep 17 00:00:00 2001 From: killian <63927363+KillianLucas@users.noreply.github.com> Date: Fri, 8 Mar 2024 22:12:22 -0800 Subject: [PATCH] Let it run server / client independently --- 01OS/01OS/clients/linux/__init__.py | 0 01OS/01OS/clients/linux/device.py | 10 ++++++++++ 01OS/start.py | 9 ++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 01OS/01OS/clients/linux/__init__.py create mode 100644 01OS/01OS/clients/linux/device.py diff --git a/01OS/01OS/clients/linux/__init__.py b/01OS/01OS/clients/linux/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/01OS/01OS/clients/linux/device.py b/01OS/01OS/clients/linux/device.py new file mode 100644 index 0000000..a9a79c0 --- /dev/null +++ b/01OS/01OS/clients/linux/device.py @@ -0,0 +1,10 @@ +from ..base_device import Device + +device = Device() + +def main(server_url): + device.server_url = server_url + device.start() + +if __name__ == "__main__": + main() diff --git a/01OS/start.py b/01OS/start.py index 8cf5dfd..3b257c3 100644 --- a/01OS/start.py +++ b/01OS/start.py @@ -86,8 +86,11 @@ def run( client_thread.start() try: - server_thread.join() - tunnel_thread.join() - client_thread.join() + if server: + server_thread.join() + if expose: + tunnel_thread.join() + if client: + client_thread.join() except KeyboardInterrupt: os.kill(os.getpid(), signal.SIGINT)