summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-12-01 21:55:28 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-12-01 22:25:46 +0100
commitf91114578c73e0ce4e417ae1344a64eed31e08ea (patch)
treed369587e83a940fff30220000f0958320bf8bc29 /pkg
parent81bc89e89404761d2fd15093f7f7ad209784e36a (diff)
[feat] disable autostart
we've agreed that the autostart behaviour can be unexpected; we'll expose the ability under preferences (it can be controlled via cli right now).
Diffstat (limited to 'pkg')
-rw-r--r--pkg/backend/init.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkg/backend/init.go b/pkg/backend/init.go
index fae5ff1..b007c61 100644
--- a/pkg/backend/init.go
+++ b/pkg/backend/init.go
@@ -72,6 +72,9 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
errCh <- err.Error()
return
}
+ // right now we just get autostart from an init flag,
+ // but we want to be able to persist that option from the preferences
+ // pane
ctx.autostart = initializeAutostart(ctx.cfg)
helpers, privilege, err := b.VPNCheck()
@@ -119,11 +122,11 @@ func initializeAutostart(conf *config.Config) bitmask.Autostart {
if conf.SkipLaunch || conf.DisableAutostart {
autostart.Disable()
autostart = &bitmask.DummyAutostart{}
- }
-
- err := autostart.Enable()
- if err != nil {
- log.Printf("Error enabling autostart: %v", err)
+ } else {
+ err := autostart.Enable()
+ if err != nil {
+ log.Printf("Error enabling autostart: %v", err)
+ }
}
return autostart
}