diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-03-27 21:33:24 +0200 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2018-04-11 01:26:37 +0200 |
commit | 2d0f7c1aa92dee25e923c31456cdd3763dec1ada (patch) | |
tree | f24ecdfa1ab1c9f7a9a73cc537f8a4583ed42576 | |
parent | dfef7e3acae8e0ccac523bf6a4e70f9b7e6e67a4 (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.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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") } |