Change: do not exit on Openvpn config error

This commit is contained in:
Quentin McGaw
2021-05-11 18:23:19 +00:00
parent c8a61ca687
commit ccc7ad7cbd
2 changed files with 10 additions and 18 deletions

View File

@@ -123,8 +123,6 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
return fmt.Errorf("command %q is unknown", args[1])
}
}
ctx, cancel := context.WithCancel(ctx)
defer cancel()
const clientTimeout = 15 * time.Second
httpClient := &http.Client{Timeout: clientTimeout}
@@ -261,7 +259,7 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
healthy := make(chan bool)
openvpnLooper := openvpn.NewLooper(allSettings.OpenVPN, nonRootUsername, puid, pgid, allServers,
ovpnConf, firewallConf, routingConf, logger, httpClient, os.OpenFile, tunnelReadyCh, healthy, cancel)
ovpnConf, firewallConf, routingConf, logger, httpClient, os.OpenFile, tunnelReadyCh, healthy)
wg.Add(1)
// wait for restartOpenvpn
go openvpnLooper.Run(ctx, wg)