From 15f83ca84a82222d934897ef7f8e98a6e19914bf Mon Sep 17 00:00:00 2001 From: gigirassy Date: Mon, 3 Aug 2026 06:17:49 +0200 Subject: [PATCH] update fanboost --- non-rice/sv/fanboost/run | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/non-rice/sv/fanboost/run b/non-rice/sv/fanboost/run index 5cb14fe..4189dfa 100644 --- a/non-rice/sv/fanboost/run +++ b/non-rice/sv/fanboost/run @@ -3,13 +3,23 @@ exec 2>&1 while true; do - temp=$(cat /sys/class/thermal/thermal_zone*/temp | sort -nr | head -1) + temp=0 - if [ "$temp" -ge 55000 ]; then - echo 1 > /sys/class/thermal/cooling_device*/cur_state - else - echo 0 > /sys/class/thermal/cooling_device*/cur_state - fi + for f in /sys/class/thermal/thermal_zone*/temp; do + [ -r "$f" ] || continue + read -r t < "$f" + [ "$t" -gt "$temp" ] && temp=$t + done - sleep 5 + if [ "$temp" -ge 55000 ]; then + state=1 + else + state=0 + fi + + for f in /sys/class/thermal/cooling_device*/cur_state; do + [ -w "$f" ] && printf '%s\n' "$state" > "$f" + done + + sleep 5 done \ No newline at end of file