I need to create an easy to go Debian VM for new developers on my team. I run a script on boot with rc.local.
This is a small test script :
#!/bin/bash exec < /dev/tty1 # Checking if user default exists if id -u "default" 1>/dev/null 2>&1; then echo "VM is not initialized" else echo "VM is initialized" fi # Trying to prompt user read -p "Hello : " world # Checking user input echo "Hello $world" exit 0
My main issue is that I can prompt user with
exec < /dev/tty1 but I can't display anything with
echo "Hello $world" or
read -p "Hello : " world.
I already manage to execute a script before gui boot with rc.local. I need to ask for user information to perform some configurations.
The script in my first message is just a test. Actually, the script prompt works but the prompt message and the echo that follows do not display since I needed to use exec < /dev/tty1 for the prompt to work. Now, I need to find a solution to be able to prompt user and to display messages.