Fix stop not cleaning up WireGuard interface (#286)

This commit is contained in:
Givi Khojanashvili
2022-03-25 16:21:04 +04:00
committed by GitHub
parent a15d52b263
commit 2aaeeac7f6
10 changed files with 101 additions and 125 deletions

View File

@@ -1,6 +1,8 @@
package cmd
import (
"context"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/wiretrustee/wiretrustee/util"
@@ -38,8 +40,10 @@ var upCmd = &cobra.Command{
return err
}
SetupCloseHandler()
return internal.RunClient(ctx, config, stopCh, cleanupCh)
var cancel context.CancelFunc
ctx, cancel = context.WithCancel(ctx)
SetupCloseHandler(ctx, cancel)
return internal.RunClient(ctx, config)
}
conn, err := DialClientGRPCServer(ctx, daemonAddr)