I used this page to try to run a shell script when the raspberry pi first turns on. This is the line I added at the bottom of the file(before exit 0
):
sh /home/pi/alexa_start.sh &
I added the ampersand, as suggested by the webstie above, because my script is a continuous script that is supposed to start Amazon Alexa. This is the script:
#!/bin/sh
cd /home/pi
lxterminal -e sh ./alexa1.sh & sleep 3
lxterminal -e sh ./alexa2.sh & sleep 20
lxterminal -e sh ./alexa3.sh
lxterminal -e sh ./alexa4.sh
It runs 4 other scripts in separate terminal windows. Upon booting the pi, nothing happened. I tried using sudo in the rc.local file and it didn't help. Is the problem the lxterminal
? How can I make this work?
EDIT:
I also tried adding this line @lxterminal -e /home/pi/alexa_start.sh
to /etc/xdg/lxsession/LXDE-pi/autostart
as suggested here, but that did not work either.