mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-16 17:35:01 +03:00
Fixed the problem of traffic statistics api url
This commit is contained in:
@@ -97,12 +97,12 @@ namespace ServiceLib.Handler
|
||||
{
|
||||
if (_process != null)
|
||||
{
|
||||
await KillProcess(_process);
|
||||
_process = await KillProcess(_process);
|
||||
}
|
||||
|
||||
if (_processPre != null)
|
||||
{
|
||||
await KillProcess(_processPre);
|
||||
_processPre = await KillProcess(_processPre);
|
||||
}
|
||||
|
||||
if (_linuxSudoPid > 0)
|
||||
@@ -321,17 +321,18 @@ namespace ServiceLib.Handler
|
||||
}
|
||||
}
|
||||
|
||||
private async Task KillProcess(Process? proc)
|
||||
private async Task<Process?> KillProcess(Process? proc)
|
||||
{
|
||||
if (proc is null)
|
||||
{
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
try { proc?.Kill(true); } catch { }
|
||||
try { proc?.Close(); } catch { }
|
||||
try { proc?.Dispose(); } catch { }
|
||||
proc = null;
|
||||
|
||||
await Task.Delay(100);
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion Process
|
||||
@@ -394,7 +395,7 @@ namespace ServiceLib.Handler
|
||||
private async Task<string> CreateLinuxShellFile(string cmdLine, string fileName)
|
||||
{
|
||||
//Shell scripts
|
||||
var shFilePath = Utils.GetBinPath(fileName);
|
||||
var shFilePath = Utils.GetBinPath(AppHandler.Instance.IsAdministrator ? "root_" + fileName : fileName);
|
||||
File.Delete(shFilePath);
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("#!/bin/sh");
|
||||
|
||||
Reference in New Issue
Block a user