summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--systray.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/systray.go b/systray.go
index c99dde9..c61ca5d 100644
--- a/systray.go
+++ b/systray.go
@@ -48,6 +48,12 @@ func run(bm *bitmask.Bitmask, conf *systrayConfig) {
}
func (bt bmTray) onExit() {
+ status, _ := bt.bm.GetStatus()
+ if status != "off" {
+ ch := bt.bm.GetStatusCh()
+ bt.bm.StopVPN()
+ status = <-ch
+ }
log.Println("Closing systray")
}