Warn about outputs found in automatic mode.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5064 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-12-04 10:28:14 +00:00
1 parent a093c97666
commit c8f47827ab
2 files changed
+30

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ SVN-HEAD
Give the fans some time to spin up
Really hide errors on sysfs writes
Deal gracefully with read-only pwm_enable files
Warn about outputs found in automatic mode
Program sensors: Hide spurious errors on missing f71872f voltage inputs
Hide spurious errors on missing adm1026 inputs
Program sensors-detect: Add Texas Instruments TMP401 detection
+29
View File
@@ -109,6 +109,21 @@ function print_devices()
done
}
# $1 = pwm file name
function is_pwm_auto()
{
if [ -n "$SYSFS" ]
then
ENABLE=${1}_enable
if [ -f $ENABLE -a "`cat $ENABLE`" -gt 1 ]
then
return 0
fi
fi
return 1
}
# $1 = pwm file name
function pwmdisable()
{
@@ -192,6 +207,20 @@ do
echo " $i"
if [ -w $i ]
then
# First check if PWM output is in automatic mode
if is_pwm_auto $i
then
echo "$i is currently setup for automatic speed control."
echo 'In general, automatic mode is preferred over manual mode, as'
echo 'it is more efficient and it reacts faster. Are you sure that'
echo -n 'you want to setup this output for manual control? (n) '
read X
if [ "$X" = "" -o "$X" != "y" -a "$X" != "Y" ]
then
continue
fi
fi
pwmdisable $i
if [ $? -ne 0 ]
then