about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/access.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/access.go b/src/access.go
index 69c8fb1..233b11c 100644
--- a/src/access.go
+++ b/src/access.go
@@ -135,6 +135,9 @@ func stopVPN() {
 	timeout := time.Second * 5
 	dockerCli.ContainerStop(dockerCtx, vpnContainerID, &timeout)
 
+	// We need to undo our stunt! Else, the network won't be deletable because "there are active endpoints"
+	dockerCli.NetworkDisconnect(dockerCtx, vpnHostNetworkID, os.Getenv("HOSTNAME"), true)
+
 	vpnContainerID = ""
 }