forked from kaboomserver/extras
CommandServerInfo.java: remove CPU info
This can be re-added if we find a way to do it without using shell commands. Closes #354
This commit is contained in:
parent
60b20ab4bf
commit
d36503ed3f
1 changed files with 0 additions and 24 deletions
|
@ -7,8 +7,6 @@ import org.bukkit.command.CommandExecutor;
|
|||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.net.InetAddress;
|
||||
|
||||
|
@ -52,28 +50,6 @@ public final class CommandServerInfo implements CommandExecutor {
|
|||
+ ManagementFactory.getRuntimeMXBean().getVmVersion()
|
||||
);
|
||||
|
||||
try {
|
||||
final String[] shCommand = {
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"cat /proc/cpuinfo | grep 'model name' | cut -f 2 -d ':' | awk '{$1=$1}1' | head -1"
|
||||
};
|
||||
|
||||
final Process process = Runtime.getRuntime().exec(shCommand);
|
||||
final InputStreamReader isr = new InputStreamReader(process.getInputStream());
|
||||
final BufferedReader br = new BufferedReader(isr);
|
||||
String line;
|
||||
|
||||
while ((line = br.readLine()) != null) {
|
||||
sendInfoMessage(sender, "CPU model",
|
||||
line
|
||||
);
|
||||
}
|
||||
|
||||
br.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
sendInfoMessage(sender, "CPU cores",
|
||||
String.valueOf(Runtime.getRuntime().availableProcessors())
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue