I want to run a script after pi boots but before log in (Raspbian Stretch Lite).
It should run after all the other configurations are done. So I thought about finding and changing the RPi log in Menu. I want to personalize this menu, besides running some other configurations.
For me, running a script at init.d didn't work:
$ cd /etc/init.d # chmod a+x TEST # chmod 777 TEST # update-rc.d TEST defaults # reboot
Then it goes directly to the normal log in menu without any print. Also when I run
# service --status-all I get
[ + ] TEST. So it does run, but can't print anything to the Terminal.
Adding my script to
/etc/bash.bashrc does work, but this file is executed after log in.
UPDATE: found that the easiest way to run script before login is simply edit the
/etc/rc.local file. echo command works (print at the terminal works) but after that, at the read command, I get:
[ FAILED] Failed to start /etc/rc.local Compatibility.
What can I do? Thanks!
#!/bin/bash # /etc/init.d/TEST echo -e "\n THIS IS A TEST" echo -e "\n THIS IS A TEST" echo -e "\n THIS IS A TEST" read var echo -e "\n You typed $var"