Fix methods for starting/stopping TUN

This commit is contained in:
Valeriy Manzhos 2026-04-08 16:45:03 +03:00
parent f6321f2e33
commit b497a479ce
No known key found for this signature in database
GPG key ID: 6547CFC8E2EC3D90

View file

@ -207,7 +207,7 @@ public class CoreManager
} }
} }
private async Task CreateTUNRoutes() public static async Task CreateTUNRoutes()
{ {
if (Utils.IsLinux()) if (Utils.IsLinux())
{ {
@ -218,7 +218,7 @@ public class CoreManager
displayLog: true, displayLog: true,
redirectInput: false, redirectInput: false,
environmentVars: null, environmentVars: null,
updateFunc: _updateFunc updateFunc: null
); );
await procService.StartAsync(AppManager.Instance.LinuxSudoPwd); await procService.StartAsync(AppManager.Instance.LinuxSudoPwd);
var procService2 = new ProcessService( var procService2 = new ProcessService(
@ -228,13 +228,13 @@ public class CoreManager
displayLog: true, displayLog: true,
redirectInput: false, redirectInput: false,
environmentVars: null, environmentVars: null,
updateFunc: _updateFunc updateFunc: null
); );
await procService2.StartAsync(AppManager.Instance.LinuxSudoPwd); await procService2.StartAsync(AppManager.Instance.LinuxSudoPwd);
} }
} }
private async Task DeleteTUNRoutes() public static async Task DeleteTUNRoutes()
{ {
if (Utils.IsLinux()) if (Utils.IsLinux())
{ {
@ -245,7 +245,7 @@ public class CoreManager
displayLog: true, displayLog: true,
redirectInput: false, redirectInput: false,
environmentVars: null, environmentVars: null,
updateFunc: _updateFunc updateFunc: null
); );
await procService.StartAsync(AppManager.Instance.LinuxSudoPwd); await procService.StartAsync(AppManager.Instance.LinuxSudoPwd);
var procService2 = new ProcessService( var procService2 = new ProcessService(
@ -255,13 +255,13 @@ public class CoreManager
displayLog: true, displayLog: true,
redirectInput: false, redirectInput: false,
environmentVars: null, environmentVars: null,
updateFunc: _updateFunc updateFunc: null
); );
await procService2.StartAsync(AppManager.Instance.LinuxSudoPwd); await procService2.StartAsync(AppManager.Instance.LinuxSudoPwd);
} }
} }
private async Task StartTUNProcess() public static async Task StartTUNProcess()
{ {
if (Utils.IsLinux()) if (Utils.IsLinux())
{ {
@ -272,7 +272,7 @@ public class CoreManager
displayLog: true, displayLog: true,
redirectInput: false, redirectInput: false,
environmentVars: null, environmentVars: null,
updateFunc: _updateFunc updateFunc: null
); );
await procService.StartAsync(AppManager.Instance.LinuxSudoPwd); await procService.StartAsync(AppManager.Instance.LinuxSudoPwd);
} }