aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard')
-rw-r--r--WireGuard/WireGuard/Tunnel/TunnelsManager.swift5
1 files changed, 5 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
index fbfd81aa..ece1e721 100644
--- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
+++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
@@ -83,6 +83,11 @@ class TunnelsManager {
matchingTunnel.refreshStatus()
} else {
// Tunnel was added outside the app
+ if let proto = loadedTunnelProvider.protocolConfiguration as? NETunnelProviderProtocol {
+ if proto.migrateConfigurationIfNeeded(called: loadedTunnelProvider.localizedDescription ?? "unknown") {
+ loadedTunnelProvider.saveToPreferences { _ in }
+ }
+ }
let tunnel = TunnelContainer(tunnel: loadedTunnelProvider)
self.tunnels.append(tunnel)
self.tunnels.sort { $0.name < $1.name }