From 2d0f7c1aa92dee25e923c31456cdd3763dec1ada Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 27 Mar 2018 21:33:24 +0200 Subject: [feat] if quit stop vpn As a side effect if the user shuts down the systray it will not autostart next time. - Related: #19 --- systray.go | 6 ++++++ 1 file changed, 6 insertions(+) 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") } -- cgit v1.2.3