From 982afbce24e46091bbd3ed91e40dd721fca7e068 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 8 Jul 2007 11:17:26 +0000 Subject: [PATCH] Only write integer values to pwm files. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4591 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/pwm/fancontrol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index 448b3d47..b6391f40 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -45,6 +45,8 @@ MAX=255 echo $$ > /var/run/fancontrol.pid +declare -i pwmval + function LoadConfig { echo "Loading configuration from $1 ..." # grep configuration from file @@ -324,7 +326,7 @@ function UpdateFanSpeeds { then pwmval=$maxpwm # over max temp, use defined max pwm else # calculate the new value from temperature and settings - let pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}" + pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}" if [ $pwmpval -eq 0 -o $fanval -eq 0 ] then # if fan was stopped start it using a safe value echo $minsa > $pwmo