(mariusr) check the other mandatory settings, make FCFANS optional

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2546 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Marius Reiner committed 2004-05-18 13:59:59 +00:00
1 parent e71960cfb5
commit 654982ccf3
1 file changed
+17 -9
+17 -9
View File
@@ -49,15 +49,17 @@ function LoadConfig {
# grep configuration from file
INTERVAL=`egrep '^INTERVAL=.*$' $1 | sed -e 's/INTERVAL=//g'`
FCTEMPS=`egrep '^FCTEMPS=.*$' $1 | sed -e 's/FCTEMPS=//g'`
FCFANS=`egrep '^FCFANS=.*$' $1 | sed -e 's/FCFANS=//g'`
MINTEMP=`egrep '^MINTEMP=.*$' $1 | sed -e 's/MINTEMP=//g'`
MAXTEMP=`egrep '^MAXTEMP=.*$' $1 | sed -e 's/MAXTEMP=//g'`
MINSTART=`egrep '^MINSTART=.*$' $1 | sed -e 's/MINSTART=//g'`
MINSTOP=`egrep '^MINSTOP=.*$' $1 | sed -e 's/MINSTOP=//g'`
if [ "$INTERVAL" = "" ]
# optional settings:
FCFANS=`egrep '^FCFANS=.*$' $1 | sed -e 's/FCFANS=//g'`
# Check whether all mandatory settings are set
if [[ -z ${INTERVAL} || -z ${FCTEMPS} || -z ${MINTEMP} || -z ${MAXTEMP} || -z ${MINSTART} || -z ${MINSTOP} ]]
then
echo "Some settings missing..."
echo "Some mandatory settings missing, please check your config file!"
exit 1
fi
# here the other settings should be verified
@@ -199,13 +201,19 @@ function UpdateFanSpeeds {
fi
pwmpval=`echo ${pwmpval} | cut -d' ' -f1`
fanval=`cat ${fan}`
if [ $? -ne 0 ]
# If fanspeed-sensor output shall be used, do it
if [[ -n ${fan} ]]
then
echo "Error reading Fan value from $DIR/$fan"
restorefans
fanval=`cat ${fan}`
if [ $? -ne 0 ]
then
echo "Error reading Fan value from $DIR/$fan"
restorefans
fi
fanval=`echo ${fanval} | cut -d' ' -f2`
else
fanval=1 # set it to a non zero value, so the rest of the script still works
fi
fanval=`echo ${fanval} | cut -d' ' -f2`
# debug info
if [ "$DEBUG" != "" ]