diff --git a/hc4_fancontrol.sh b/hc4_fancontrol.sh index abe932a..052cac6 100755 --- a/hc4_fancontrol.sh +++ b/hc4_fancontrol.sh @@ -6,15 +6,16 @@ # Information (don't touch unless you're me) AUTHOR="david@socialnerds.org" -VERSION="0.2.0" +VERSION="0.2.1" LICENSE="GPLv3" # Configuration -THRESHOLD=45000 +THRESHOLD=46000 DISTANCE=1000 INTERVAL=30 -STEPS=(80 120 160 210 255) +STEPS=(120 160 210 255) FAN="/sys/class/hwmon/hwmon2/pwm1" +LOGFILE="/var/log/hc4_fancontrol.log" # Get all temperature readings and return the highest value function get_temp() { @@ -40,6 +41,9 @@ function set_speed() { local NEW_SPEED=$1 if [ $CURRENT_SPEED -ne $NEW_SPEED ]; then echo $NEW_SPEED > $FAN + if [ -n $LOGFILE ]; then + echo "$(date +%Y%m%d-%H%M%S): Temp[$(get_temp)], Speed[$(get_speed)]" >> $LOGFILE + fi sleep 3 fi }