diff --git a/cpufan.sh b/cpufan.sh index 7129bdb..736c1b1 100644 --- a/cpufan.sh +++ b/cpufan.sh @@ -17,8 +17,7 @@ i=0 sleep_time=9 while [ $i -lt 6 ]; do # 6 ten-second intervals in 1 minute PREVIOUS_SPEED=`cat $CPU_FAN` - CPU_TEMP=`sensors coretemp-isa-0000 | grep "CPU Temp" | grep -o '[0-9]*' | head -1` - CPU_TEMP=$((CPU_TEMP)) # Convert to Number + CPU_TEMP=$(sensors coretemp-isa-0000 | grep "CPU Temp" | grep -o '[0-9]*' | head -1) echo "CPU Temp: "$CPU_TEMP"" @@ -26,9 +25,9 @@ while [ $i -lt 6 ]; do # 6 ten-second intervals in 1 minute NEW_PWM=$((FAN_LOW_PWM)) elif ((CPU_TEMP >= HIGH_TEMP)); then NEW_PWM=$((FAN_HIGH_PWM)) - elif ((CPU_TEMP >= 30 && CPU_TEMP < 35)); then + elif ((CPU_TEMP > LOW_TEMP && CPU_TEMP < 35)); then NEW_PWM=$((FAN_LOW_PWM + 35)) - elif ((CPU_TEMP >= 35 && $CPU_TEMP < 40)); then + elif ((CPU_TEMP >= 35 && CPU_TEMP < 40)); then NEW_PWM=$((FAN_LOW_PWM + 35*2)) elif ((CPU_TEMP >= 40 && CPU_TEMP < 50)); then NEW_PWM=$((FAN_LOW_PWM + 35*3))