- if [ $newmhz -ge $safemhz ]; then
- answer=$(DISPLAY=0:0 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 $?)
- echo $answer
- if [ $answer = 1 ]; then exit 1; fi
- fi
+ if [ $newmhz -ge $safemhz ]; then
+ if [ $DISPLAY ]; then
+ 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 $?)
+ echo $answer
+ if [ $answer = 1 ]; then exit 1; fi
+ else
+ 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
+ echo $answer
+ if [ $answer = n ]; then exit 1; fi
+ fi
+ fi