Maint: use VPN settings instead of OpenVPN in loop

This commit is contained in:
Quentin McGaw (desktop)
2021-08-18 21:27:09 +00:00
parent 538bc72c3c
commit 05018ec971
7 changed files with 26 additions and 25 deletions

View File

@@ -22,11 +22,11 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
}
for ctx.Err() == nil {
openVPNSettings, providerSettings, allServers := l.state.GetSettingsAndServers()
VPNSettings, providerSettings, allServers := l.state.GetSettingsAndServers()
providerConf := provider.New(providerSettings.Name, allServers, time.Now)
serverName, err := setup(ctx, l.fw, l.openvpnConf, providerConf, openVPNSettings, providerSettings)
serverName, err := setup(ctx, l.fw, l.openvpnConf, providerConf, VPNSettings.OpenVPN, providerSettings)
if err != nil {
l.crashed(ctx, err)
continue
@@ -42,7 +42,7 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
tunnelReady := make(chan struct{})
go l.openvpnConf.Run(openvpnCtx, waitError, tunnelReady,
l.logger, openVPNSettings)
l.logger, VPNSettings.OpenVPN)
if err := l.waitForError(ctx, waitError); err != nil {
openvpnCancel()