diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index a7705af9..bf95e5a4 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -548,7 +548,7 @@ function pwmenable() fi # enable manual control by fancontrol echo 1 > $ENABLE 2> /dev/null - if [ $? -ne 0 ] + if [ "$(cat $ENABLE)" -ne 1 ] then return 1 fi diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 253086c6..409031e9 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -215,14 +215,12 @@ function pwmenable() { local ENABLE=${1}_enable - if [ -w $ENABLE ] + echo 1 > $ENABLE 2>/dev/null + if [ "$(cat $ENABLE)" -ne 1 ] then - echo 1 2>/dev/null > $ENABLE - if [ $? -ne 0 ] - then - return 1 - fi + return 1 fi + echo $MAX > $1 }