I need to execute this command on the RASPBERRY PI bootup

cd RPi_Cam_Web_Interface && ./install.sh

and also follows dual ENTER keys with 5 seconds interval for each.

  • 4
    Why do you want to run an install script at every startup? You would normally install just once! – CoderMike Feb 11 at 18:51
  • its an pi-Cam web interface , which shows live preview from the picam. but it is not starting at BOOT , even though the auto start is enabled – Reaghan Pius Feb 12 at 12:31
  • What happens when you enter 'cd RPi_Cam_Web_Interface' then './start.sh' ? – CoderMike Feb 12 at 13:56
  • when entered ./start.sh it just skips to the next line without executing anything – Reaghan Pius Feb 12 at 17:53
  • This is a typical X/Y problem. Rather than asking about the workaround you invented, explain your original issue (pi-Cam web interface not starting at boot?) and see what alternative solutions are possible. – Dmitry Grigoryev Mar 6 at 15:38

thanks People, i finally made it work by using this below command: \cd /home/pi/RPi_Cam_Web_Interface && ./install.sh and saved this as an Script and finally mentioned this script at the botom line of "sudo nano .bashrc" and now when i boot my pi,the software is installed freshly.

  • Seems like this would only run when you log in, not when you boot. – Glen Yates Feb 13 at 17:41

There are a few ways to execute a boot command. I use the rc.local file. sudo nano /etc/rc.local Add your shell command before the exit 0

for entering two enter keypress you can something along the lines of

cd RPi_Cam_Web_Interface && ./install.sh
echo | <yourfinecommandhere>
sleep 5s
echo | <yourfinecommandhere>
  • Please take note that using /etc/rc.local has limitations due to Compatibility with SysV. Following the recommendation of the developers from systemd you should avoid using it. – Ingo Feb 11 at 22:16
  • I think the OP has misunderstood how RPi-Cam-Web-Interface works. – CoderMike Feb 12 at 13:58

I believe you could also use sudo crontab -e and just add a command with the absolute path (/usr/bin/foo). To run a command at boot and reboot in the background (so it doesn't prevent pi from continuing boot), add @reboot /usr/bin/foo&

  • No comment on why this is a downvoted method? – pcs3rd Mar 11 at 0:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.