diff --git a/pkg/backend/init.go b/pkg/backend/init.go index 6e236abd041613be42a55f1f5a27521c818467cb..7be8b19afb5c1b7f8ecc567462cc6f6bf2dcb305 100644 --- a/pkg/backend/init.go +++ b/pkg/backend/init.go @@ -74,9 +74,10 @@ func initializeBitmask(errCh chan string, opts *InitOpts) { Err(err). Msg("Could not initialize bitmask") errCh <- err.Error() - return } + ctx.bm = b + // right now we just get autostart from an init flag, // but we want to be able to persist that option from the preferences // pane @@ -99,7 +100,6 @@ func initializeBitmask(errCh chan string, opts *InitOpts) { log.Error().Msg("Could not find polkit") errCh <- "nopolkit" } - ctx.bm = b ctx.IsReady = true } diff --git a/pkg/vpn/bitmask.go b/pkg/vpn/bitmask.go index bc53112f6792c3f211a83ece25bead0bef0b883d..5e174cefceae72e0b2aed52ba110c5aeec46860d 100644 --- a/pkg/vpn/bitmask.go +++ b/pkg/vpn/bitmask.go @@ -119,8 +119,7 @@ func Init() (*Bitmask, error) { Str("caCertPath", b.getTempCaCertPath()). Msg("Sucessfully wrote OpenVPN CA certificate (hardcoded in the binary, not coming from API)") - err = b.launch.FirewallStop() - if err != nil { + if err := b.launch.FirewallStop(); err != nil { log.Warn(). Err(err). Msg("Could not stop firewall")