5

Getting console input during system startup

view full story
linux-howto

http://forums.fedoraforum.org – I am setting up a system for students to use to run lab-based exams. On bootup, the system needs to download an encrypted file containing the exam files, and then ask for a decryption password. I want to do this during system startup (before anyone logs in). But I am having trouble getting keyboard input at this point. I've put a script in /etc/rc.d/rc5.d/S99examsetup along the following lines: Code: #!/bin/bash echo -n "Enter password:" read EXAMPW echo "You gave me: $EXAMPW" but it doesn't respond to keyboard input. I have tried appending "< /dev/console" but this also doesn't work; in fact if I insert 'tty' before the first 'echo', it tells me that /dev/console is the tty being used for input anyway. Is there a way round this? I can use plymouth ask-for-password, but that doesn't seem very portable, and it interacts badly with the graphics driver on one of my machines. Any help gratefully received. James (HowTos)