Skip to content

Run script at startup

Maxi edited this page May 27, 2020 · 3 revisions

To make the script run at startup, follow these steps. This will run the script in a detached screen.

  1. Create a folder startup at ~ or run mkdir ~/startup
  2. Create a file with nano startup.sh
  3. Copy the following content
#!/bin/bash

# Start speedtest-display
cd ~/speedtest-display/
python3 run-speedtest-display.py
exit
  1. Make the script executable with chmod +x startup.sh
  2. Install screen with sudo apt-get install screen
  3. Open sudo nano /etc/rc.local
  4. Paste su - pi -c "screen -dm -S pistartup ~/startup/startup.sh". This runs your startup script with every boot in a detached screen.
  5. Reboot with sudo reboot to take effect.
Clone this wiki locally