Merge pull request 'fancontrol, pwmconfig: Allow read-only pwm*_enable' (#344) from amezin/master into master

Note: strip superfluous parentheses
This commit is contained in:
hramrach authored and Michal Suchanek committed 2023-12-24 12:20:04 +01:00
commit fb35c5b4fa
2 files changed
+5 -7

No files matched your search

+1 -1
View File
@@ -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
+4 -6
View File
@@ -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
}