summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
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
}