wait_for_input() { while true do echo -n "Please choose one of the above [$last_selection]: " /dev/tty0 2>&1 read junk < /dev/tty0 2>&1 # This is required to work around an annoying busybox bug. # Every key you press while this script runs will be # picked up by the next "read $junk". And there's no goddamn way # to prevent it. So the next read would pick up the "any" key the user pressed # above to launch the altboot menu. junk="`echo "$junk" | sed -n "s/.*\([0-9]\)/\1/p"`"