From a8d4d1eaef59b368ff16a2882bfa8cf91733c330 Mon Sep 17 00:00:00 2001 From: Sir_Yaro Date: Wed, 30 Dec 2020 20:33:26 +0100 Subject: [PATCH] Update pwmconfig If sensor doesn't return any value (in my case it happen when fan got broken - look below) whole script gets messed up. "cut" latter in the script assume there are more values in $GOODFAN then there are really and "cut -d' ' -f$count" doesn't return proper value. root@yaro-desktop2:/sys/class/hwmon# cat hwmon0/fan1_input cat: hwmon0/fan1_input: Bad argument root@yaro-desktop2:/sys/class/hwmon# --- prog/pwm/pwmconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index edcbde9e..f12146e8 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -284,7 +284,7 @@ echo 'Found the following fan sensors:' for i in $FAN do S=$(cat $i) - if [ "$S" = "0" -o "$S" = "-1" ] + if [ "$S" = "0" -o "$S" = "-1" -o "$S" = "" ] then echo " $i current speed: 0 ... skipping!" else