checks if mpv is not running and if it isn't then it starts it (avoids crashes)
This commit is contained in:
parent
731f285071
commit
54b2e84dcf
12
mpvmusic.sh
12
mpvmusic.sh
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user