1
1
Fork 0

woring on 0.2 of fancontrol script

This commit is contained in:
david 2023-09-23 09:21:43 +02:00
parent bc7a8067c9
commit 64890504aa
1 changed files with 19 additions and 0 deletions

19
hc4_fancontrol.sh Normal file → Executable file
View File

@ -1,9 +1,28 @@
#!/bin/bash
#
# Odroid HC4 fan control script
#
# Information (don't touch unless you're me)
AUTHOR="david@socialnerds.org"
VERSION="0.2.0"
LICENSE="GPLv3"
# Configuration
THRESHOLD=42000
DISTANCE=2000
INTERVAL=30
STEPS=(120 160 210 255)
FAN="/sys/class/hwmon/hwmon2/pwm1"
function get_temp() {
local TEMP=($(cat /sys/devices/virtual/thermal/thermal_zone*/temp))
for I in ${TEMP[@]}; do
echo "temp: $I"
done
}
# set fan mode to manual
echo "disabled" | tee /sys/class/thermal/thermal_zone{0,1}/mode > /dev/null