0

im looking for solution, how to edit some files to specify which bash file (it's called startupScript.sh) should start after booting the device. I'm using bash version, without GUI. But the script should read a keyboard input, after booting up.

I have attempted to modify /.bashrc and even /etc/rc.local, but it didn't work for me. Also driverboot.service... I'm seeking a solution for my script to start a FastAPI server (using uvicorn). In the file named startupScript.sh, there is the code sudo uvicorn main:app, and this should initiate my server even after a reboot.

2
  • If it needs to read the keyboard you'll need to start it at a point where the keyboard is alive and ready for input. So for a non-GUI way your ~/.bashrc method may be OK except it gets called whenever a new shell gets started. For a GUI way you need to open an lxterminal and set the command running in there. I'd do that from the GUI autostart file.
    – Dougie
    Commented Jan 8 at 23:08
  • Does this answer your question? Changing .bashrc to run python script
    – Milliways
    Commented Jan 8 at 23:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.