Optimized and improved the code

Optimized and improved the code for killing core processes in non-Windows environments. Now uses a shell script for precise processing.
This commit is contained in:
2dust
2025-07-30 19:52:45 +08:00
parent 6715d7dce6
commit 3d23f3e3a2
9 changed files with 170 additions and 46 deletions
@@ -23,14 +23,7 @@ public class ProxySettingOSX
private static async Task ExecCmd(List<string> args)
{
var fileName = Utils.GetBinConfigPath(_proxySetFileName);
if (!File.Exists(fileName))
{
var contents = EmbedUtils.GetEmbedText(Global.ProxySetOSXShellFileName);
await File.AppendAllTextAsync(fileName, contents);
await Utils.SetLinuxChmod(fileName);
}
var fileName = await FileManager.CreateLinuxShellFile(_proxySetFileName, EmbedUtils.GetEmbedText(Global.ProxySetOSXShellFileName), false);
await Utils.GetCliWrapOutput(fileName, args);
}