Shorten the Linux terminator

No need to overcomplicate things. Also, no risk of killing the entire program with this.
This commit is contained in:
ME1312 2021-04-08 10:44:41 -04:00
parent ff82fd5151
commit 18953046b8
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ public class Executable {
if (Platform.getSystem() == Platform.WINDOWS) {
Runtime.getRuntime().exec(new String[]{"taskkill.exe", "/T", "/F", "/PID", pid.toString()}).waitFor();
} else if (USE_SESSION_TRACKING) {
Runtime.getRuntime().exec(new String[]{"bash", "-c", "kill -9 $(ps -o pid= --sid $(ps -o sid= --pid " + pid + "))"}).waitFor();
Runtime.getRuntime().exec(new String[]{"bash", "-c", "kill -9 $(ps -s " + pid + " -o pid=)"}).waitFor();
}
} catch (IOException | InterruptedException e) {}

View File

@ -98,7 +98,7 @@ public class Executable {
if (Platform.getSystem() == Platform.WINDOWS) {
Runtime.getRuntime().exec(new String[]{"taskkill.exe", "/T", "/F", "/PID", pid.toString()}).waitFor();
} else if (USE_SESSION_TRACKING) {
Runtime.getRuntime().exec(new String[]{"bash", "-c", "kill -9 $(ps -o pid= --sid $(ps -o sid= --pid " + pid + "))"}).waitFor();
Runtime.getRuntime().exec(new String[]{"bash", "-c", "kill -9 $(ps -s " + pid + " -o pid=)"}).waitFor();
}
} catch (IOException | InterruptedException e) {}