mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 04:25:45 +00:00
Add a method for killing hev-socks5-tunnel
This commit is contained in:
parent
f54b45ba5e
commit
ebdfb34670
1 changed files with 16 additions and 0 deletions
|
|
@ -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)
|
private async Task UpdateFunc(bool notify, string msg)
|
||||||
{
|
{
|
||||||
await _updateFunc?.Invoke(notify, msg);
|
await _updateFunc?.Invoke(notify, msg);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue