And '' and 'WantedBy' tells the pi what file to use to run the script.Īfter you finish pasting your code, use Ctrl + O to write out (save) your file, click enter to confirm the file to write, and then Ctrl + X to exit the editor. The file paths after those tell the pi to open your sound files using omxplayer. 'ExecStart' and 'ExecStop' are short for "Execute on Start" and "Execute on Stop". 'Type' declares the type of script it is, and 'RemainAfterExit' declares whether or not the the 'Exec' commands should be run after the service is stopped. The top '' lines do nothing to the script, but they let the user see what the purpose of the file is. 1.35M subscribers 1. Paste the following code into the editor: ĭescription=Runs script at system shutdownĮxecStart=/bin/omxplayer /etc/sound/startup.mp3ĮxecStop=/bin/omxplayer /etc/sound/shutdown.mp3 After entering the command, you will be presented with a blank text editor, which is your files contents. This creates a new file called "rvice" located in '/etc/systemd/system' in the nano editor. Open a new terminal, and enter sudo nano /etc/systemd/system/rvice
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |