From 10d5eddadd08aafc7876c327ab543de11a28f2ff Mon Sep 17 00:00:00 2001 From: casjay Date: Sat, 10 Sep 2022 17:32:15 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/entrypoint-music.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/entrypoint-music.sh b/bin/entrypoint-music.sh index 19c9ff5..5b4fbed 100755 --- a/bin/entrypoint-music.sh +++ b/bin/entrypoint-music.sh @@ -48,12 +48,10 @@ __exec_bash() { } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __start() { - if ! pgrep mpd &>/dev/null; then - mpd --verbose /config/mpd/mpd.conf - fi - sleep 10 - mpc queued | grep '^' mpc load all + pgrep mpd &>/dev/null || mpd "/config/mpd/mpd.conf" + sleep 3 if pgrep mpd &>/dev/null; then + mpc queued 2>&1 | grep '^' || mpc load all mpc status 2>&1 | grep -q 'playing' || mpc play &>/dev/null else echo "MPD seems to have not started" 1>&2 @@ -124,7 +122,9 @@ if ! pgrep mpd &>/dev/null; then [ -f "/data/mpd/mpd.pid" ] && rm -Rf "/data/mpd/mpd.pid" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -find /data/music/ -iname *.mp3 -type f >/data/playlists/all.m3u +if [ ! -f "/data/playlists/all.m3u" ]; then + find "/data/music/" -iname '*.mp3' -type f >"/data/playlists/all.m3u" +fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - chmod 777 -Rf "/data/mpd" "/data/navidrome" "/data/music" "/data/playlists" "/config/mpd" chown -Rf mpd "/config/mpd" "/data/mpd"