3 minmhz="$(cat /etc/pandora/conf/cpu.conf | grep 'min:' | awk -F\: '{print $2}')"
4 safemhz="$(cat /etc/pandora/conf/cpu.conf | grep 'safe:' | awk -F\: '{print $2}')"
5 maxmhz="$(cat /etc/pandora/conf/cpu.conf | grep 'max:' | awk -F\: '{print $2}')"
6 warn="$(cat /etc/pandora/conf/cpu.conf | grep 'warn:' | awk -F\: '{print $2}')"
7 device=/proc/pandora/cpu_mhz_max
8 curmhz="$(cat $device)"
9 newmhz="$(cat $device)"
10 kernel_major=`uname -r | cut -c 1`
12 if [ ! -e $device ]; then
13 if [ -z "$1" -a -n "$DISPLAY" ]; then
14 zenity --info --title="CPU-Settings not supported" --text \
15 "Sorry, the experimental kernel does not support setting the clockspeed (yet)."
22 newmhz=$(zenity --scale --text "Set CPU clockspeed" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1)
24 newmhz=$(read -p "Please enter the desired clockspeed")
31 if [ $newmhz -gt $safemhz ]; then
32 if [ $warn != no ]; then
34 answer=$(zenity --question --title "Alert" --text "You are trying to set the CPU clock to $newmhz which is above its specification of $safemhz, doing so may burn down your house, sour milk, or just blow up (OK, not that likely)! Proceed?";echo $?)
36 if [ $answer = 1 ]; then exit 1; fi
38 answer="n";read -p "You are trying to set the CPU clock to $newmhz which is above its specification of $safemhz, doing so may burn down your house, sour milk, or just blow up (OK, not that likely)! Proceed? [y/n]" -t 10 answer
40 if [ $answer = n ]; then exit 1; fi
45 if [ $newmhz -le $minmhz ]; then newmhz=$minmhz; fi
46 if [ $newmhz -ge $maxmhz ]; then newmhz=$maxmhz; fi
47 echo $newmhz > $device
48 echo cpu_mhz_max set to $(cat $device)