05-07-2024, 05:39 PM
(This post was last modified: 05-07-2024, 05:54 PM by tiago.trindade.)
For those who might be in a similar situation, I manage to find a solution.
1) created a file (with nano) named start_music.sh
2) edited the file with these inputs:
sleep 10 # Wait for 10 seconds after aplying this
mpc clear # Clear the current playlist
mpc load 'Default Playlist' # Load the playlist named 'Default Playlist'
mpc volume 50
mpc play # Start playing the music
sleep 1 # Wait for 1 second
mpc volume 100
mpc stop # Stop the playback after 1 second
3) changed permission using
chmod +x start_music.sh
4) executed
crontab -e
5) added the following line
@reboot sleep 30 && /path/to/your/script/start_music.sh
6) save and exit
(Make sure to replace /path/to/your/script/ with the actual path where you saved your script.Save the crontab file and exit the editor)
done
1) created a file (with nano) named start_music.sh
2) edited the file with these inputs:
sleep 10 # Wait for 10 seconds after aplying this
mpc clear # Clear the current playlist
mpc load 'Default Playlist' # Load the playlist named 'Default Playlist'
mpc volume 50
mpc play # Start playing the music
sleep 1 # Wait for 1 second
mpc volume 100
mpc stop # Stop the playback after 1 second
3) changed permission using
chmod +x start_music.sh
4) executed
crontab -e
5) added the following line
@reboot sleep 30 && /path/to/your/script/start_music.sh
6) save and exit
(Make sure to replace /path/to/your/script/ with the actual path where you saved your script.Save the crontab file and exit the editor)
done