killing process now shows process name in event logs #7197

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458
2025-07-31 15:39:04 +01:00
parent f723486fc4
commit 1e534282ac
4 changed files with 31 additions and 29 deletions

View File

@@ -1302,8 +1302,10 @@ function handleServerCommand(data) {
case 'pskill': {
// Kill a process
if (data.value) {
MeshServerLogEx(19, [data.value], "Killing process " + data.value, data);
try { process.kill(data.value); } catch (ex) { sendConsoleText("pskill: " + JSON.stringify(ex)); }
var info = data.value.split('|'), pid = data.value, msg = " (Unknown)";
if (info.length > 1) { pid = info[0]; msg = " (" + info[1] + ")"; } else { info[1] = "Unknown"; }
MeshServerLogEx(19, info, "Killing process " + pid + msg, data);
try { process.kill(parseInt(pid)); } catch (ex) { sendConsoleText("pskill: " + JSON.stringify(ex)); }
}
break;
}