Contribution: Checking for single Key press with Busybox ash

Harald Becker ralda at
Fri Jul 12 14:44:47 UTC 2013

Hi All,

as here are many shell script novices, I want to post a simple
Busybox ash script to check for a single key press. I use this
during startup to switch from normal operation to rescue mode. If
no Escape key is pressed within 2 seconds the system starts up in
normal mode, else a simple rescue shell is invoked via sulogin.

The script just uses only usual Busybox applets and does not
need any special program to check the keyboard.

Script attached ... 

Comments/questions welcome.

-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/x-shellscript
Size: 487 bytes
Desc: not available
URL: <>

More information about the busybox mailing list