device=/proc/pandora/cpu_mhz_max
curmhz="$(cat $device)"
newmhz="$(cat $device)"
-kernel_major=`uname -r | cut -c 1`
+
+if [ "$1" = "-n" ]; then
+ shift
+ warn=no
+fi
if [ ! -e $device ]; then
if [ -z "$1" -a -n "$DISPLAY" ]; then
if [ $DISPLAY ]; then
newmhz=$(zenity --scale --text "Set CPU clockspeed" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1)
else
- newmhz=$(read -p "Please enter the desired clockspeed")
+ read -p "Please enter the desired clockspeed: " newmhz
fi
else
newmhz=$1
fi
+if ! [ 0 -lt "$newmhz" -a "$newmhz" -lt 10000 ]; then
+ echo "invalid argument: $newmhz"
+ exit 1
+fi
+
if [ $newmhz ]; then
if [ $newmhz -gt $safemhz ]; then
if [ $warn != no ]; then