diff options
Diffstat (limited to 'pkg/bitmask')
-rw-r--r-- | pkg/bitmask/bitmask.go | 1 | ||||
-rw-r--r-- | pkg/bitmask/init.go | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/pkg/bitmask/bitmask.go b/pkg/bitmask/bitmask.go index 927e486..adfc849 100644 --- a/pkg/bitmask/bitmask.go +++ b/pkg/bitmask/bitmask.go @@ -20,6 +20,7 @@ type Bitmask interface { Close() Version() (string, error) StartVPN(provider string) error + CanStartVPN() bool StopVPN() error ReloadFirewall() error GetStatus() (string, error) diff --git a/pkg/bitmask/init.go b/pkg/bitmask/init.go index a96ab87..b86deb8 100644 --- a/pkg/bitmask/init.go +++ b/pkg/bitmask/init.go @@ -131,7 +131,10 @@ func maybeStartVPN(b Bitmask, conf *config.Config) error { return nil } - err := b.StartVPN(config.Provider) - conf.SetUserStoppedVPN(false) - return err + if b.CanStartVPN() { + err := b.StartVPN(config.Provider) + conf.SetUserStoppedVPN(false) + return err + } + return nil } |