diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -54,6 +54,7 @@ func main() { log.Printf("Is bitmask running? %v", err) return } + maybeStartVPN(b, conf) run(b, conf) } @@ -77,6 +78,18 @@ func checkAndInstallHelpers(b *bitmask.Bitmask, notify *notificator) error { return nil } +func maybeStartVPN(b *bitmask.Bitmask, conf *systrayConfig) { + if conf.UserStoppedVPN { + return + } + + err := b.StartVPN(provider) + if err != nil { + log.Println("Error starting VPN: ", err) + } + conf.setUserStoppedVPN(false) +} + func initPrinter() { locale, err := go_locale.DetectLocale() if err != nil { |