From 5d34cf323f67a1652e80e9a0b594457fc5466bf3 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 20 Jun 2021 21:40:41 +0200 Subject: [PATCH] Fix LoadEvaluation --- src/de/steamwar/bungeecore/LoadEvaluation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/LoadEvaluation.java b/src/de/steamwar/bungeecore/LoadEvaluation.java index 0732d75..59fda6c 100644 --- a/src/de/steamwar/bungeecore/LoadEvaluation.java +++ b/src/de/steamwar/bungeecore/LoadEvaluation.java @@ -64,7 +64,7 @@ public class LoadEvaluation { public static double getCPULoad() { try { - Process process = new ProcessBuilder("cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | awk -v RS=\"\" '{printf \"%.2f\\n\", ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}'").start(); + Process process = new ProcessBuilder("bash", "-c", "cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | awk -v RS=\"\" '{printf \"%.2f\\n\", ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}'").start(); process.waitFor(); return Double.parseDouble(new BufferedReader(new InputStreamReader(process.getInputStream())).readLine()) / 100.0; } catch (IOException e) {