VirtualBox

Ticket #6771: setfan.sh

File setfan.sh, 548 bytes (added by turgut kalfaoglu, 14 years ago)
Line 
1#!/bin/sh
2
3OLD_SPEED="0"
4OLD_TEMP="0"
5
6setSpeed () {
7 if [ "$1" != "$OLD_SPEED" ]; then
8 echo "new speed $1"
9 OLD_SPEED="$1"
10 ./fan "$1" > /dev/null
11 fi
12}
13
14while [ 1 ]; do
15 TEMP=`cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $2}'`
16 if [ "$TEMP" != "$OLD_TEMP" ]; then
17 echo "temperature $TEMP C"
18 OLD_TEMP="$TEMP"
19 fi
20
21 if [ $TEMP -gt 65 ]; then
22 setSpeed auto
23 elif [ $TEMP -gt 60 ]; then
24 setSpeed 13
25 elif [ $TEMP -gt 55 ]; then
26 setSpeed 11
27 elif [ $TEMP -gt 50 ]; then
28 setSpeed 9
29 else
30 setSpeed 1
31 fi
32
33 sleep 2
34done

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy