diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-12-16 13:54:03 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-12-16 20:58:52 +0100 |
commit | c2317a1f99ff778010385aad11745eb75d6a1900 (patch) | |
tree | e58ed853022036130aece07baf62c14d38f68ac9 /pkg | |
parent | a114b25c5720cedc93bec36e4fa822fe6cfa85b4 (diff) |
[bug] fix osx quits from app menu and dock
aboutToQuit let us catch Quits coming from the osx menu or the dock.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/helper/darwin.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/helper/darwin.go b/pkg/helper/darwin.go index a9f8e00..2db92a5 100644 --- a/pkg/helper/darwin.go +++ b/pkg/helper/darwin.go @@ -36,6 +36,7 @@ import ( "path/filepath" "strconv" "strings" + "time" "github.com/sevlyar/go-daemon" ) @@ -135,9 +136,16 @@ func firewallStop() error { log.Printf("An error ocurred stopping the firewall: %v", out) /* TODO return error if different from anchor not exists */ /*return errors.New("Error while stopping firewall")*/ - return nil } - return nil + for _ = range [50]int{} { + if firewallIsUp() { + log.Printf("Firewall still up, waiting...") + time.Sleep(200 * time.Millisecond) + } else { + return nil + } + } + return errors.New("Could not stop firewall") } func firewallIsUp() bool { |