From dc358a6eda5041522385b10c2eb1fb3d6274a2a6 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Thu, 29 Sep 2022 17:15:35 -0300 Subject: [PATCH] macos: Fix hanging --start when Lokinet already running If you stop/start the GUI but it doesn't exit on start, the second --start (when lokinet is already running) waits for a state change that doesn't come (because lokinet is already running). This add a check for already-running so that we exit right away in such a case. --- daemon/lokinet.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/lokinet.swift b/daemon/lokinet.swift index da946e1d6..adf11e9f3 100644 --- a/daemon/lokinet.swift +++ b/daemon/lokinet.swift @@ -116,6 +116,12 @@ class LokinetMain: NSObject, NSApplicationDelegate { } catch { self.result(msg: "There was a fatal error") } + + // Check if we are already connected because, if so, we won't get a + // status change and will just hang waiting for one. + if self.vpnManager.connection.status == .connected { + self.result(msg: "VPN already connected"); + } } }) }