mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-29 12:50:43 +00:00
pwmconfig, fancontrol: Allow read-only pwm*_enable
Don't fail if pwm*_enable is read-only, but already set to 1.
This commit is contained in:
1 parent
42f240d2a4
commit
49b6ae283d
2 files changed
+6
-8
No files matched your search
+2
-2
@@ -489,8 +489,8 @@ function pwmenable()
|
||||
PWM_ORIG_STATE[${1}]=$PWM_ORIG
|
||||
fi
|
||||
# enable manual control by fancontrol
|
||||
echo 1 > $ENABLE 2> /dev/null
|
||||
if [ $? -ne 0 ]
|
||||
(echo 1 > $ENABLE) 2> /dev/null
|
||||
if [ "$(cat $ENABLE)" -ne 1 ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
+4
-6
@@ -214,14 +214,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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user