Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion jupiter_scripts/fan-control
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ daemon() {
led_toggle
current_temp=$(temp)

if [[ $current_temp -ge 65247000 ]]; then
profile_load_status=$(iio_attr -d adrv9002-phy profile_config)
if [[ $profile_load_status == "No profile loaded..." ]]; then
profile_status="FAILED"
else
profile_status="OK"
fi
fi

last_five=("${last_five[@]:1}")
last_five+=("$current_temp")

Expand All @@ -54,7 +63,7 @@ daemon() {
done
average=$(expr $average / 5)

if [[ $average -ge $TEMP_POWEROFF ]]; then
if [[ $average -ge $TEMP_POWEROFF ]] && [[ $profile_status != "FAILED" ]]; then
poweroff
fi

Expand Down
Loading