Changeset 2177
- Timestamp:
- 12/14/03 20:19:52 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/pwm/pwmconfig (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/pwm/pwmconfig
r2048 r2177 1 # 2 # pwmconfig v0.5 1 #!/bin/bash 2 # 3 # pwmconfig v0.6 3 4 # Tests the pwm outputs of sensors and configures fancontrol 4 5 # … … 137 138 PLOT= 138 139 139 type gnuplot> /dev/null 2>&1140 type $PLOTTER > /dev/null 2>&1 140 141 if [ $? -eq 0 ] 141 142 then 142 echo -n " Would you like to generate a graphical plot using $PLOTTER (y) ? "143 echo -n " Would you like to generate a graphical plot using $PLOTTER (y)? " 143 144 read X 144 145 if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ] … … 248 249 echo " Fan $j has not returned to speed, please investigate!" 249 250 else 250 echo -n " Would you like to generate a detailed correlation (y)? "251 echo -n "Would you like to generate a detailed correlation (y)? " 251 252 read X 252 253 if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ] … … 261 262 done 262 263 echo 263 if [ "$pwmactivecount" = "0" ] 264 then 265 echo "No correlations were detected, there is either no fan connected to the output of $i, or the connected fan has no rpm-signal connected to one of the tested fan sensors. (Note: not all motherboards have the pwm outputs connected to the fan connectors, check out the hardware database on http://www.almico.com/forumindex.php)" 266 echo 267 echo -n " Did you see/hear a fan stopping during the above test (y)?" 268 read X 269 if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ] 270 then 271 pwmactive="$i ${pwmactive}" 272 fi 273 fi 264 if [ "$pwmactivecount" = "0" ] 265 then 266 echo "No correlations were detected." 267 echo "There is either no fan connected to the output of $i," 268 echo "or the connected fan has no rpm-signal connected to one of" 269 echo "the tested fan sensors. (Note: not all motherboards have" 270 echo "the pwm outputs connected to the fan connectors," 271 echo "check out the hardware database on http://www.almico.com/forumindex.php)" 272 echo 273 echo -n "Did you see/hear a fan stopping during the above test (n)? " 274 read X 275 if [ "$X" = "y" -o "$X" = "Y" ] 276 then 277 pwmactive="$i ${pwmactive}" 278 fi 279 echo 280 fi 274 281 done 275 282 … … 279 286 echo 280 287 echo 'The fancontrol script can automatically respond to temperature changes' 281 echo 'of your system by changing fanspeeds. Do you want to set up its'282 echo 'configuration file now? (y)'288 echo 'of your system by changing fanspeeds.' 289 echo -n 'Do you want to set up its configuration file now (y)? ' 283 290 284 291 read X … … 296 303 297 304 function AskPath { 298 echo 'What should be the path to your fancontrol config file? (/etc/fancontrol)'305 echo -n 'What should be the path to your fancontrol config file (/etc/fancontrol)? ' 299 306 300 307 read X … … 307 314 FCCONFIG=$X 308 315 else 309 echo "$X does not exist, shall I create it now? (y)"316 echo -n "$X does not exist, shall I create it now (y)? " 310 317 read Y 311 318 if [ "$Y" = "y" -o "$Y" = "Y" -o "$Y" = "" ] … … 337 344 function TestMinStart { 338 345 echo 339 echo 'Now we increase the PWM value in 10-unit-steps. Let the fan stop completely, then press return until the fan starts spinning, we will use this value +20 to be safe.' 346 echo 'Now we increase the PWM value in 10-unit-steps.' 347 echo 'Let the fan stop completely, then press return until the' 348 echo 'fan starts spinning. We will use this value +20 to be safe.' 340 349 let fanok=0 341 350 let fanval=0 … … 343 352 do 344 353 let fanval=fanval+10 354 if [ $fanval -gt 240 ] ; then let fanval=255 ; let fanok=1 ; fi 345 355 echo -n "Setting $pwms to $fanval..." 346 356 echo $fanval > $pwms … … 349 359 done 350 360 let fanval=fanval+20 351 if (( $fanval > 240 )); then let fanval=255 ; fi361 if [ $fanval -gt 240 ] ; then let fanval=255 ; fi 352 362 echo "OK, using $fanval" 353 363 echo 255 > $pwms … … 356 366 function TestMinStop { 357 367 echo 358 echo 'Now we decrease the PWM value in 10-unit-steps, Let the fan has reach full speed, then press return until the fan stops spinning, we will use this value +20 as the minimum speed.' 368 echo 'Now we decrease the PWM value in 10-unit-steps.' 369 echo 'Let the fan reach full speed, then press return until the' 370 echo 'fan stops spinning. We will use this value +20 as the minimum speed.' 359 371 let fanok=0 360 372 let fanval=255 … … 362 374 do 363 375 let fanval=fanval-10 364 if (( $fanval < 0 )) ; then fanval=0; fi376 if [ $fanval -lt 0 ] ; then let fanval=0 ; let fanok=1 ; fi 365 377 echo -n "Setting $pwms to $fanval..." 366 378 echo $fanval > $pwms … … 369 381 done 370 382 let fanval=fanval+20 371 if (( $fanval > 255 )); then let fanval=255 ; fi383 if [ $fanval -gt 255 ] ; then let fanval=255 ; fi 372 384 echo "OK, using $fanval" 373 385 echo 255 > $pwms … … 388 400 389 401 INTERVAL=10 402 PS3='select (1-n): ' 403 DEFMINTEMP=0 404 DEFMAXTEMP=60 405 DEFMINSTART=150 406 DEFMINSTOP=100 390 407 391 408 #the section below has a high potential for usability improvements 392 409 echo 393 echo 'Select fan output to configure :'410 echo 'Select fan output to configure, or other action:' 394 411 select pwms in $pwmactive "Change INTERVAL" "Just quit" "Save and quit" "Show configuration"; do 395 412 case $pwms in 396 413 "Change INTERVAL") 397 414 echo 398 echo "Enter the interval at which fancontrol should update PWM values (in s):" 415 echo "Current interval is $INTERVAL seconds." 416 echo -n "Enter the interval at which fancontrol should update PWM values (in s):" 399 417 read INTERVAL ;; #check user input here 400 418 "Just quit") … … 419 437 echo ;; 420 438 421 "`echo ${pwmactive} |sed -e \"s/ /\n/g\"| egrep \"${pwms}\"`" )439 "`echo ${pwmactive} |sed -e 's/ /\n/g' | egrep \"${pwms}\"`" ) 422 440 pwmsed=`echo ${pwms} | sed -e 's/\//\\\\\//g'` #escape / for sed 423 441 echo … … 437 455 fi 438 456 echo 439 echo 'Enter the minimum temperature at which the fan should be switched off:' 457 echo 'Enter the low temperature (C)' 458 echo -n "at which the fan should be switched off ($DEFMINTEMP): " 440 459 read XMT 460 if [ "$XMT" = "" ] 461 then 462 XMT=$DEFMINTEMP 463 fi 441 464 if [ "$MINTEMP" = "" ] 442 465 then … … 446 469 fi 447 470 echo 448 echo 'Enter the maximum temperature at which the fan should be switched to full speed:' 471 echo 'Enter the high temperature (C)' 472 echo -n "at which the fan should be switched to full speed ($DEFMAXTEMP): " 449 473 read XMT 474 if [ "$XMT" = "" ] 475 then 476 XMT=$DEFMAXTEMP 477 fi 450 478 if [ "$MAXTEMP" = "" ] 451 479 then … … 455 483 fi 456 484 echo 457 echo 'Enter the minimum PWM value at which the fan STARTS spinning (press return to test):' 485 echo 'Enter the minimum PWM value (0-255)' 486 echo -n "at which the fan STARTS spinning (press t to test) ($DEFMINSTART): " 458 487 read XMV 459 488 if [ "$XMV" = "" ] 489 then 490 XMV=$DEFMINSTART 491 fi 492 if [ "$XMV" = "t" -o "$XMV" = "T" ] 460 493 then 461 494 TestMinStart … … 469 502 fi 470 503 echo 471 echo 'Enter the minimum PWM value at which the fan STOPS spinning (press return to test):' 504 echo 'Enter the minimum PWM value (0-255)' 505 echo -n "at which the fan STOPS spinning (press t to test) ($DEFMINSTOP): " 472 506 read XMV 473 507 if [ "$XMV" = "" ] 508 then 509 XMV=$DEFMINSTOP 510 fi 511 if [ "$XMV" = "t" -o "$XMV" = "T" ] 474 512 then 475 513 TestMinStop … … 486 524 487 525 *) 488 echo "No such option, press RETURN to show menu" ;; 526 grep $pwm 527 528 echo "No such option. Enter a number." ;; 489 529 esac 490 530 done
