mirror of
https://github.com/ME1312/SubServers-2.git
synced 2025-02-19 05:01:44 +01:00
Remove unnecessary launch flags
This allows users on non-linux but unix-based systems to install ports of the `setsid` command that might not be feature complete.
This commit is contained in:
parent
18953046b8
commit
0ac4238dc8
@ -32,7 +32,7 @@ public class Executable {
|
||||
exec.replace("\\", "/\\").replace("\"", "\\\"").replace("^", "^^").replace("%", "^%").replace("&", "^&").replace("<", "^<").replace(">", "^>").replace("|", "^|") + '"';
|
||||
cmd = new String[]{"cmd.exe", "/q", "/c", '"'+exec+'"'};
|
||||
} else if (USE_SESSION_TRACKING) {
|
||||
cmd = new String[]{"setsid", "-w", "sh", "-lc", exec};
|
||||
cmd = new String[]{"setsid", "sh", "-lc", exec};
|
||||
} else {
|
||||
cmd = new String[]{"sh", "-lc", exec};
|
||||
}
|
||||
@ -41,7 +41,7 @@ public class Executable {
|
||||
|
||||
static {
|
||||
USE_SESSION_TRACKING = Platform.getSystem() != Platform.WINDOWS && Util.getDespiteException(() -> {
|
||||
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "-w", "bash", "-c", "exit 0"});
|
||||
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "bash", "-c", "exit 0"});
|
||||
test.waitFor(); // The purpose of this block is to test for the 'setsid' command
|
||||
return test.exitValue() == 0;
|
||||
}, false);
|
||||
|
@ -32,7 +32,7 @@ public class Executable {
|
||||
exec.replace("\\", "/\\").replace("\"", "\\\"").replace("^", "^^").replace("%", "^%").replace("&", "^&").replace("<", "^<").replace(">", "^>").replace("|", "^|") + '"';
|
||||
cmd = new String[]{"cmd.exe", "/q", "/c", '"'+exec+'"'};
|
||||
} else if (USE_SESSION_TRACKING) {
|
||||
cmd = new String[]{"setsid", "-w", "sh", "-lc", exec};
|
||||
cmd = new String[]{"setsid", "sh", "-lc", exec};
|
||||
} else {
|
||||
cmd = new String[]{"sh", "-lc", exec};
|
||||
}
|
||||
@ -41,7 +41,7 @@ public class Executable {
|
||||
|
||||
static {
|
||||
USE_SESSION_TRACKING = Platform.getSystem() != Platform.WINDOWS && Util.getDespiteException(() -> {
|
||||
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "-w", "bash", "-c", "exit 0"});
|
||||
Process test = Runtime.getRuntime().exec(new String[]{"setsid", "bash", "-c", "exit 0"});
|
||||
test.waitFor(); // The purpose of this block is to test for the 'setsid' command
|
||||
return test.exitValue() == 0;
|
||||
}, false);
|
||||
|
Loading…
Reference in New Issue
Block a user