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 curmhz="$(cat /proc/pandora/cpu_mhz_max)"
8 newmhz="$(cat /proc/pandora/cpu_mhz_max)"
9 device=/proc/pandora/cpu_mhz_max
12 newmhz=$(zenity --scale --text "Set CPU clockspeed" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1)
14 newmhz=$(read -p "Please enter the desired clockspeed")
20 if [ $newmhz -gt $safemhz ]; then
21 if [ $warn != no ]; then
23 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 $?)
25 if [ $answer = 1 ]; then exit 1; fi
27 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
29 if [ $answer = n ]; then exit 1; fi
34 if [ $newmhz -le $minmhz ]; then newmhz=$minmhz; fi
35 if [ $newmhz -ge $maxmhz ]; then newmhz=$maxmhz; fi
36 echo $newmhz > $device
37 echo cpu_mhz_max set to $(cat /proc/pandora/cpu_mhz_max)