I was expecting a basic thermostat with hysteresis, but no, it's a stepwise proportional control. Your fan could very well wind up oscillating at one of the step transition points which is probably not great for the fan.
There is no need to call cat to read from a file.<p>> temp=$(cat /sys/class/thermal/thermal_zone1/temp)<p>temp=$(</sys/class/thermal/thermal_zone1/temp)
I have spent countless hours trying to get hardware to be silent.<p>The only way to do this reliably and without fire hazard is to passively cool the hardware completely by having HUGE heatsinks and THEN you can add a fan that you slow down with a resistor.<p>The fan is only there to prolong the life span, the hardware should be able to run passivley at 100% and you should be able to hold your finger on the heatsink forever. If not you have a problem.<p>All other solutions are just meaningless.<p><a href="http://streacom.com" rel="nofollow">http://streacom.com</a>
As an alternative, been using this PID fan control script to keep my HDDs cool for ages. <a href="https://forums.freenas.org/index.php?threads/pid-fan-controller-perl-script.50908/" rel="nofollow">https://forums.freenas.org/index.php?threads/pid-fan-control...</a>
> if ((temp > 90000)); then<p>What is this syntax? I would have assume something like `[ $temp -gt 90000 ]` or `$((temp > 90000))`. Is the dollar here optional? Is this something bash specific?
The second solution on this page probably isn't reliable, because hwmon paths like `hwmon3` depend on module load order.<p>That's likely the same reason for the `card*` workaround mentioned above.<p>I am using thinkfan for this and it works really well: <a href="https://github.com/vmatare/thinkfan" rel="nofollow">https://github.com/vmatare/thinkfan</a>