![]() |
How to properly add add python script to autostart - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: Community (https://moodeaudio.org/forum/forumdisplay.php?fid=18) +--- Forum: General Discussion (https://moodeaudio.org/forum/forumdisplay.php?fid=21) +--- Thread: How to properly add add python script to autostart (/showthread.php?tid=7031) |
How to properly add add python script to autostart - vol.rom - 10-24-2024 Hello I'm using Retroflag NESPi Case for my Raspberry Pi. I tried to add this script but without success: https://github.com/RetroFlag/retroflag-picase/blob/master/SafeShutdown.py I deleted os.system("sudo killall emulationstation") and tried to run it but I failed to do so. Any ideas how to set it properly? Thanks, Volodymyr RE: How to properly add add python script to autostart - Tim Curtis - 10-24-2024 Try posting in their repo https://github.com/RetroFlag/retroflag-picase/issues RE: How to properly add add python script to autostart - vol.rom - 10-24-2024 I did post there, but I also wanted to know how to properly install such scripts on Moode OS. Additionally, I have an extra fan installed on the board, and I've written a script that activates the fan when the temperature gets too high. RE: How to properly add add python script to autostart - vol.rom - 10-24-2024 Solved by converting py script to bash Steps: sudo nano /opt/SafeShutdown.sh Code: #!/bin/bash sudo apt-get update sudo apt-get install pigpio python3-pigpio sudo systemctl enable pigpiod sudo systemctl start pigpiod chmod +x /opt/SafeShutdown.sh sudo nano /etc/systemd/system/SafeShutdown.service Code: [Unit] sudo systemctl enable SafeShutdown.service sudo systemctl start SafeShutdown.service sudo reboot - h now done ![]() |