Changeset 4295

Show
Ignore:
Timestamp:
01/14/07 16:20:06 (7 years ago)
Author:
khali
Message:

fancontrol.pl:
* Disable debugging by default
* Add support for non-i2c drivers
* More tolerant config file parsing (for some reason pwmconfig

adds unneeded spaces, it should probably be fixed but it's always
better to be tolrant nevertheless)

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4292 r4295  
    3333  Programs pwmconfig, fancontrol: Handle write errors for bash 3.1 
    3434                                  Add support for non-i2c drivers 
     35  Program fancontrol.pl: Disable debugging by default 
     36                         Add support for non-i2c drivers 
     37                         More tolerant config file parsing 
    3538  Program sensord: Add pc87247 support (fans only) 
    3639                   Add vt1211 support (#2150) 
  • lm-sensors/trunk/prog/pwm/fancontrol.pl

    r3025 r4295  
    4848 
    4949##### Configuration ##### 
    50 use constant DEBUG => 1; 
     50use constant DEBUG => 0; 
    5151use constant MAX   => 255; 
    5252 
     
    5555use constant LOGFILE  => '/var/log/fancontrol/fancontrol.log'; 
    5656use constant ERRFILE  => '/var/log/fancontrol/fancontrol.err'; 
    57  
    58 use constant SDIR => '/sys/bus/i2c/devices'; 
    5957### End Configuration ### 
    6058 
     
    120118if (!(-d $dir)) 
    121119   { 
    122      if (!(-d SDIR)) 
     120     if ($afcpwm[0] =~ m/^hwmon\d/) 
     121       { 
     122         $dir = '/sys/class/hwmon'; 
     123       } 
     124     else 
     125       { 
     126         $dir = '/sys/bus/i2c/devices'; 
     127       } 
     128 
     129     if (!(-d $dir)) 
    123130       { die("No sensors found! (are the necessary modules loaded?) :  
    124131$!\n"); } 
     
    126133       { 
    127134         $sysfs = 1; 
    128          $dir = SDIR; 
    129135       } 
    130136   } 
     
    174180     { 
    175181       if ($_ =~ /^\s+$/)                { next; } 
    176        elsif ($_ =~ /^INTERVAL=(.*)$/) { $interval = $1; next; } 
    177        elsif ($_ =~ /^FCTEMPS=(.*)$/)  { $fctemps = $1;  next; } 
    178        elsif ($_ =~ /^FCFANS=(.*)$/)   { $fcfans = $1;   next; } 
    179        elsif ($_ =~ /^MINTEMP=(.*)$/)  { $mintemp = $1;  next; } 
    180        elsif ($_ =~ /^MAXTEMP=(.*)$/)  { $maxtemp = $1;  next; } 
    181        elsif ($_ =~ /^MINSTART=(.*)$/) { $minstart = $1; next; } 
    182        elsif ($_ =~ /^MINSTOP=(.*)$/)  { $minstop = $1;  next; } 
     182       elsif ($_ =~ /^INTERVAL=\s*(.*)$/) { $interval = $1; next; } 
     183       elsif ($_ =~ /^FCTEMPS=\s*(.*)$/)  { $fctemps = $1;  next; } 
     184       elsif ($_ =~ /^FCFANS=\s*(.*)$/)   { $fcfans = $1;   next; } 
     185       elsif ($_ =~ /^MINTEMP=\s*(.*)$/)  { $mintemp = $1;  next; } 
     186       elsif ($_ =~ /^MAXTEMP=\s*(.*)$/)  { $maxtemp = $1;  next; } 
     187       elsif ($_ =~ /^MINSTART=\s*(.*)$/) { $minstart = $1; next; } 
     188       elsif ($_ =~ /^MINSTOP=\s*(.*)$/)  { $minstop = $1;  next; } 
    183189     } 
    184190   close(F);