Changeset 5335

Show
Ignore:
Timestamp:
09/10/08 09:33:05 (2 months ago)
Author:
khali
Message:

Indentation fixes, drop trailing whitespace.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/prog/pwm/fancontrol

    r5272 r5335  
    6161        MINPWM=`egrep '^MINPWM=.*$' $1 | sed -e 's/MINPWM=//g'` 
    6262        MAXPWM=`egrep '^MAXPWM=.*$' $1 | sed -e 's/MAXPWM=//g'` 
    63          
     63 
    6464        # Check whether all mandatory settings are set 
    6565        if [[ -z ${INTERVAL} || -z ${FCTEMPS} || -z ${MINTEMP} || -z ${MAXTEMP} || -z ${MINSTART} || -z ${MINSTOP} ]] 
     
    7676 
    7777        # write settings to arrays for easier use and print them 
    78         echo 
     78       echo 
    7979        echo "Common settings:" 
    8080        echo "  INTERVAL=$INTERVAL" 
    81                                                  
     81 
    8282        let fcvcount=0 
    8383        for fcv in $FCTEMPS 
     
    150150 
    151151if [ -f "$1" ] 
    152 then  
     152then 
    153153        LoadConfig $1 
    154154else 
     
    174174                SYSFS=1 
    175175                DIR=$SDIR 
    176         fi      
     176        fi 
    177177fi 
    178178cd $DIR 
     
    269269                minpwm=${AFCMINPWM[$fcvcount]} 
    270270                maxpwm=${AFCMAXPWM[$fcvcount]} 
    271                  
     271 
    272272                read tval < ${tsens} 
    273273                if [ $? -ne 0 ] 
     
    293293                        pwmpval=`echo ${pwmpval} | cut -d' ' -f1` 
    294294                fi 
    295                  
     295 
    296296                # If fanspeed-sensor output shall be used, do it 
    297297                if [[ -n ${fan} ]] 
     
    310310                        fanval=1  # set it to a non zero value, so the rest of the script still works 
    311311                fi 
    312                  
     312 
    313313                # debug info 
    314314                if [ "$DEBUG" != "" ] 
     
    327327                        echo "fanval=$fanval" 
    328328                fi 
    329                  
     329 
    330330                if (( $tval <= $mint )) 
    331331                  then pwmval=$minpwm # below min temp, use defined min pwm 
    332332                elif (( $tval >= $maxt )) 
    333333                  then pwmval=$maxpwm # over max temp, use defined max pwm 
    334                 else  
     334                else 
    335335                  # calculate the new value from temperature and settings 
    336336                  pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}" 
  • lm-sensors/trunk/prog/pwm/fancontrol.8

    r4438 r5335  
    2626.SH CONFIGURATION 
    2727For easy configuration, there's a script 
    28 named \fBpwmconfig\fP(8) which lets you interactively write your  
    29 configuration file for \fBfancontrol\fP. Alternatively you can write this  
     28named \fBpwmconfig\fP(8) which lets you interactively write your 
     29configuration file for \fBfancontrol\fP. Alternatively you can write this 
    3030file yourself using the information from this manpage. 
    3131 
     
    105105.SH CONFORMING TO 
    106106lm_sensors-2.x 
    107         
     107 
    108108.SH SEE ALSO 
    109109pwmconfig(8), sensors(1). 
  • lm-sensors/trunk/prog/pwm/fancontrol.pl

    r4588 r5335  
    128128 
    129129     if (!(-d $dir)) 
    130        { die("No sensors found! (are the necessary modules loaded?) :  
     130       { die("No sensors found! (are the necessary modules loaded?) : 
    131131$!\n"); } 
    132132     else 
     
    1631631; 
    164164 
    165 ################################################################  
     165################################################################ 
    166166sub loadconfig($) 
    167167{ 
     
    175175   open(F, $file); 
    176176 
    177    our ($interval, $fctemps, $fcfans, $mintemp, $maxtemp, $minstart,  
     177   our ($interval, $fctemps, $fcfans, $mintemp, $maxtemp, $minstart, 
    178178$minstop); 
    179179   while($_ = <F>) 
     
    220220 
    221221 
    222 ################################################################  
     222################################################################ 
    223223sub pwmdisable($) 
    224224{ 
     
    261261 
    262262 
    263 #################################################################  
     263################################################################# 
    264264sub pwmenable($) 
    265265{ 
     
    294294 
    295295 
    296 ################################################################  
     296################################################################ 
    297297sub restorefans() 
    298298{ 
     
    316316 
    317317 
    318 ############################################################  
     318############################################################ 
    319319sub UpdateFanSpeeds() 
    320320{ 
  • lm-sensors/trunk/prog/pwm/pwmconfig

    r5319 r5335  
    5656                echo $0: 'No sensors found! (modprobe sensor modules?)' 
    5757                exit 1 
    58         fi      
     58        fi 
    5959fi 
    6060 
     
    316316                if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ] 
    317317                then 
    318                         PLOT=y          
     318                        PLOT=y 
    319319                fi 
    320320        fi 
     
    337337        while [ $pwm -ge 0 ] 
    338338        do 
    339                 pwmset $P $pwm   
     339                pwmset $P $pwm 
    340340                sleep $PDELAY 
    341341                if [ $? -ne 0 ] 
    342342                then 
    343                         pwmdisable $P   
     343                        pwmdisable $P 
    344344                        echo '^C received, aborting...' 
    345345                        rm -f $TMP1 $TMP2 
    346346                        exit 1 
    347                 fi              
     347                fi 
    348348                # this will return the first field if there's only one (sysfs) 
    349349                S=`cat $F | cut -d' ' -f2` 
     
    355355                if [ "$S" = "0" -o "$S" = "-1" ] 
    356356                then 
    357                         pwmdisable $P   
     357                        pwmdisable $P 
    358358                        echo "    Fan Stopped at PWM = $pwm" 
    359359                        if [ $pwm -eq $MAX ] 
     
    376376                fi 
    377377        done 
    378         pwmdisable $P   
     378        pwmdisable $P 
    379379        if [ "$PLOT" = "y" ] 
    380380        then 
     
    401401                echo '^C received, restoring PWM and aborting...' 
    402402                exit 1 
    403         fi              
     403        fi 
    404404        let pwmactivecount=0 
    405405        let count=1 
     
    432432                                echo '^C received, aborting...' 
    433433                                exit 1 
    434                         fi              
     434                        fi 
    435435                        # this will return the first field if there's only one (sysfs) 
    436436                        S=`cat $j | cut -d' ' -f2` 
     
    587587 
    588588function TestMinStop { 
    589         echo 
    590         echo 'Now we decrease the PWM value in 10-unit-steps.' 
     589       echo 
     590       echo 'Now we decrease the PWM value in 10-unit-steps.' 
    591591        echo 'Let the fan reach full speed, then press return until the' 
    592592        echo "fan stops spinning. Then enter 'y'." 
    593593        echo 'We will use this value +20 as the minimum speed.' 
    594         let fanok=0 
    595         let fanval=$MAX 
     594       let fanok=0 
     595       let fanval=$MAX 
    596596 
    597597        pwmenable $pwms 
    598         until [ "$fanok" = "1" ] 
    599         do 
    600                 let fanval=fanval-10 
     598       until [ "$fanok" = "1" ] 
     599       do 
     600               let fanval=fanval-10 
    601601                if [ $fanval -lt 0 ] ; then let fanval=0 ; let fanok=1 ; fi 
    602                 echo -n "Setting $pwms to $fanval..." 
     602               echo -n "Setting $pwms to $fanval..." 
    603603                pwmset $pwms $fanval 
    604                 read FANTEST 
     604               read FANTEST 
    605605                if [ "$FANTEST" != "" ] ; then let fanok=1 ; fi 
    606         done 
     606       done 
    607607        pwmdisable $pwms 
    608608 
    609         let fanval=fanval+20 
    610         if [ $fanval -gt $MAX ] ; then let fanval=$MAX ; fi 
    611         echo "OK, using $fanval" 
     609       let fanval=fanval+20 
     610       if [ $fanval -gt $MAX ] ; then let fanval=$MAX ; fi 
     611       echo "OK, using $fanval" 
    612612} 
    613613 
     
    696696                        if [ "$tempss" = "None (Do not affect this PWM output)" ] 
    697697                        then 
    698                          
     698 
    699699                                break; 
    700700                        else 
     
    731731                        then 
    732732                                MAXTEMP="${pwms}=${XMT}" 
    733                         else 
     733                       else 
    734734                                MAXTEMP="`echo $MAXTEMP | sed -e \"s/${pwmsed}[^ ]* *//g\"` ${pwms}=${XMT}" 
    735735                        fi 
     
    801801                        break; 
    802802                done ;; 
    803          
     803 
    804804        *) 
    805805                grep $pwm 
  • lm-sensors/trunk/prog/pwm/pwmconfig.8

    r2873 r5335  
    1515It attempts to briefly stop each fan using the PWM controls. It then 
    1616attempts to restore each fan to full speed after testing. However, it 
    17 is \fBvery important\fP that you physically verify that the fans have  
     17is \fBvery important\fP that you physically verify that the fans have 
    1818been returned to full speed after the program has completed. 
    1919 
    2020.SH WARNING 
    2121This program will stop your fans, one at a time, for approximately 5 seconds each. 
    22 This may cause your processor temperature to rise. Verify that all fans are running  
     22This may cause your processor temperature to rise. Verify that all fans are running 
    2323at normal speed after this program has exited. 
    2424