summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-03-27 21:33:24 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2018-04-11 01:26:37 +0200
commit2d0f7c1aa92dee25e923c31456cdd3763dec1ada (patch)
treef24ecdfa1ab1c9f7a9a73cc537f8a4583ed42576
parentdfef7e3acae8e0ccac523bf6a4e70f9b7e6e67a4 (diff)
[feat] if quit stop vpn
As a side effect if the user shuts down the systray it will not autostart next time. - Related: #19
-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")
}