I am working with a raspberry Pi, and what I need is to make it launch scripts at startup when internet connection is active. I found a solution by setting instructions to be launched in the file below:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Here are all the instructions I tried to set in the autostart file :
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@ngrok http 888
@cd ~/Desktop/app
@git checkout master
@git pull origin master
@ruby /home/pi/Desktop/app/script1.rb some_argument
@python3 /home/pi/Desktop/app/script2.py
@xscreensaver -no-splash
My issue is that ngrok instruction, and both python and ruby scripts are executed. However, something is not working with the git pull, and therefore, both ruby and python scripts that should be updated with the git pull are not.
My other issue is I do not know how to test this properly other than just rebooting the raspberry, and looking at the results of my scripts to see if the most current version of the scripts was executed or not.
Anyone knows how I could correct this issue, or how I could test ?
I tried "startx" but I get the error below:
parse_vt_settings: Cannot open /dev/tty0 (permission denied)
Any help ? Thanks a lot !
network-online.service
: freedesktop.org/wiki/Software/systemd/NetworkTarget