Add a method for killing hev-socks5-tunnel

This commit is contained in:
Valeriy Manzhos 2026-04-08 17:51:20 +03:00
parent f54b45ba5e
commit ebdfb34670
No known key found for this signature in database
GPG key ID: 6547CFC8E2EC3D90

View file

@ -278,6 +278,22 @@ public class CoreManager
}
}
public static async Task KillTUNProcess()
{
if (Utils.IsLinux())
{
var procService = new ProcessService(
fileName: "/usr/bin/sudo",
arguments: "-uv2rayn-core /usr/bin/pkill --pidfile /run/user/785/v2rayn-hev-socks5-tunnel.pid",
workingDirectory: Utils.GetBinConfigPath(),
displayLog: true,
redirectInput: false,
environmentVars: null,
updateFunc: null
);
await procService.StartAsync(AppManager.Instance.LinuxSudoPwd);
}
}
private async Task UpdateFunc(bool notify, string msg)
{
await _updateFunc?.Invoke(notify, msg);