From d5ebfe425f13b6b584bc0541a900aab1150d9e1f Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 9 Dec 2018 13:50:47 +0100 Subject: bin/realtime-suggestions: Changing check for policy directory in check_cpu_governor(), so that we fail if we don't at least find one policy dir. --- bin/realtime-suggestions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/realtime-suggestions b/bin/realtime-suggestions index 9235651..cf5f599 100755 --- a/bin/realtime-suggestions +++ b/bin/realtime-suggestions @@ -102,12 +102,12 @@ check_max_user_watches() { } check_cpu_governor() { - local governor_dir="/sys/devices/system/cpu/cpufreq/" + local policy_dir="/sys/devices/system/cpu/cpufreq/" local cpupower_ref="(see \`man cpupower\` for reference)" local governor="" local policy_no="" local cpu_no="" - if [ -d "${governor_dir}" ]; then + if [ -d "${policy_dir}/policy0" ]; then for governor_file in /sys/devices/system/cpu/cpufreq/policy*/scaling_governor; do governor="$(cat "$governor_file")" policy_no="$(echo "$governor_file"| cut -d'/' -f7)" @@ -117,7 +117,7 @@ check_cpu_governor() { fi done else - echo "$warning Unable to detect any CPU governor on your machine. ${governor_dir} does not exist!" + echo "$warning Unable to detect any CPU governor on your machine. ${policy_dir} is empty!" fi } -- cgit v1.2.3-54-g00ecf