checks if mpv is not running and if it isn't then it starts it (avoids crashes)

This commit is contained in:
DeaDvey 2024-11-04 22:39:30 +00:00
parent 731f285071
commit 54b2e84dcf

View File

@ -17,7 +17,17 @@ source $config_path
previous_songs_path=""
#find $playlist_path -type f > song_list.txt
mpv --shuffle --really-quiet $playlist_path --input-ipc-server=/tmp/mpvsocket &
while [ 1 == 1 ]; do
mpv_running=$(pidof mpv)
if [ -z "$mpv_running" ]; then
echo "mpv process not found, (re)starting..."
mpv --shuffle --really-quiet $playlist_path --input-ipc-server=/tmp/mpvsocket &
else
echo "mpv is already running"
fi
sleep 1
done &
sleep 1
while [ 1 == 1 ]; do