lm_sensors-fancontrol.patch 1.0 KB

123456789101112131415161718192021222324252627282930
  1. --- prog/pwm/fancontrol 2012-11-07 03:26:37.000000000 +0200
  2. +++ prog/pwm/fancontrol 2013-03-22 18:15:00.566696011 +0200
  3. @@ -297,7 +297,7 @@
  4. cd $DIR
  5. # Check for configuration change
  6. -if [ "$DIR" != "/" ] && [ -z "$DEVPATH" -o -z "$DEVNAME" ]
  7. +if [[ "$DIR" != "/" && ( -z "$DEVPATH" || -z "$DEVNAME" ) ]]
  8. then
  9. echo "Configuration is too old, please run pwmconfig again" >&2
  10. exit 1
  11. @@ -337,7 +337,7 @@
  12. # It didn't work, try pwmN_enable=1 pwmN=255
  13. echo 1 > $ENABLE 2> /dev/null
  14. echo $MAX > $1
  15. - if [ `cat $ENABLE` -eq 1 -a `cat $1` -ge 190 ]
  16. + if [ `cat $ENABLE` -eq 1 ] && [ `cat $1` -ge 190 ]
  17. then
  18. # Success
  19. return 0
  20. @@ -469,7 +469,7 @@
  21. else
  22. # calculate the new value from temperature and settings
  23. pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
  24. - if [ $pwmpval -eq 0 -o $min_fanval -eq 0 ]
  25. + if [ $pwmpval -eq 0 ] || [ $min_fanval -eq 0 ]
  26. then # if fan was stopped start it using a safe value
  27. echo $minsa > $pwmo
  28. # Sleep while still handling signals