diff options
author | Christian Rößler | 2015-08-11 17:07:51 +0200 |
---|---|---|
committer | Christian Rößler | 2015-08-11 17:07:51 +0200 |
commit | b854e01e4681ad334191f3f345f3e9dd66b300db (patch) | |
tree | ee52b14e703166690dfc1bf5e447cfbf5aeca6f0 /remote | |
parent | [auth-freiburg] Corr. linking of .local/share/applications/mimeapps.list (diff) | |
download | tm-scripts-b854e01e4681ad334191f3f345f3e9dd66b300db.tar.gz tm-scripts-b854e01e4681ad334191f3f345f3e9dd66b300db.tar.xz tm-scripts-b854e01e4681ad334191f3f345f3e9dd66b300db.zip |
[cpugovernor] No systemd error when machine does not support ondemand mode
Diffstat (limited to 'remote')
-rwxr-xr-x | remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor b/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor index 115163c7..f7aa255a 100755 --- a/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor +++ b/remote/modules/cpugovernor/data/opt/openslx/scripts/systemd-cpu_governor @@ -15,7 +15,7 @@ else # use 'ondemand' per default TARGET_GOVERNOR="ondemand" fi -echo "Setting governor to $TARGET_GOVERNOR" +echo "Trying to set CPU governor to $TARGET_GOVERNOR" # global information needed # CORES is the range of cores present, on bwpc4 it has the value '0-3' # thus the split: MINCORE=0 MAXCORE=3 @@ -39,7 +39,7 @@ test_for_gov() { local i=$MINCORE while [ $i -le $MAXCORE ]; do # check if the given governor is supported - grep -q "${GOVERNOR}" /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_governors || return 1; + grep -q "${GOVERNOR}" /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_governors 2>/dev/null || return 1; # increment true $(( i++ )) done @@ -58,5 +58,5 @@ if test_for_gov "${TARGET_GOVERNOR}"; then done else echo "ERROR: '${TARGET_GOVERNOR}' is not supported by this machine!" - exit 1 + exit 0 fi |