summaryrefslogtreecommitdiff
path: root/armbian-envtemp-cpufreq.sh
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-06-08 00:10:48 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-06-08 00:10:48 +0300
commit329d868cb0a6d032ae65004afee5ac0f1b75033d (patch)
tree41118754e351ec8c6f566abddd6b863248951f3c /armbian-envtemp-cpufreq.sh
parente0f5b902c638f1f9b389efe05ad15a2764ed81fc (diff)
reverse temp prioritiesHEADmaster
Diffstat (limited to 'armbian-envtemp-cpufreq.sh')
-rw-r--r--armbian-envtemp-cpufreq.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/armbian-envtemp-cpufreq.sh b/armbian-envtemp-cpufreq.sh
index a4513ba..5557ee0 100644
--- a/armbian-envtemp-cpufreq.sh
+++ b/armbian-envtemp-cpufreq.sh
@@ -100,8 +100,8 @@ envtemp=$(echo "$response" | jq ".temp" | awk "{print int(\$1+0.5)}")
# setting corresponding cpu freq
while read temp; do
freq=${values[$temp]}
- (( envtemp >= temp )) && break
-done < <(for temp in ${!values[@]}; do echo $temp; done | sort -rn)
+ (( envtemp <= temp )) && break
+done < <(for temp in ${!values[@]}; do echo $temp; done | sort -n)
echo -n "$freq" > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
logger -t "$(basename "$PROGNAME")" "Environment temperature is $envtemp C, set max CPU frequency to $freq."