From 5e870c9583f3c054b11a1d0783edeb25b08c876a Mon Sep 17 00:00:00 2001 From: casjay Date: Tue, 6 Sep 2022 23:58:51 -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 | 18 ++++++++++++------ config/nginx/navidrome.conf | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/entrypoint-music.sh b/bin/entrypoint-music.sh index 9937b7e..7b25b1a 100755 --- a/bin/entrypoint-music.sh +++ b/bin/entrypoint-music.sh @@ -97,7 +97,12 @@ fi if [ ! -L "/etc/nginx/http.d/default.conf" ]; then ln -sf "/config/nginx/navidrome.conf" "/etc/nginx/http.d/default.conf" fi - +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +if ! pgrep mpd &>/dev/null; then + [ -f "/data/mpd/mpd.pid" ] && rm -Rf "/data/mpd/mpd.pid" +fi +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +chmod 777 -R /data/mpd /data/navidrome /data/music /data/playlists # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case "$1" in --help) # Help message @@ -109,9 +114,10 @@ case "$1" in ;; healthcheck) # Docker healthcheck - echo "$(uname -s) $(uname -m) is running" - echo _other_commands here - exitCode=$? + pgrep mpd &>/dev/null && + pgrep nginx &>/dev/null && + pgrep navidrome &>/dev/null + exit $? ;; */bin/sh | */bin/bash | bash | shell | sh) # Launch shell @@ -122,8 +128,8 @@ healthcheck) # Docker healthcheck *) # Execute primary command if [ $# -eq 0 ]; then - [ -f "/data/mpd/mpd.pid" ] && rm -Rf "/data/mpd/mpd.pid" - mpd --no-daemon /config/mpd/mpd.conf & + nginx + mpd /config/mpd/mpd.conf navidrome --configfile /config/navidrome/navidrome.toml else __exec_bash "/bin/bash" diff --git a/config/nginx/navidrome.conf b/config/nginx/navidrome.conf index 689d5b9..e071fcc 100644 --- a/config/nginx/navidrome.conf +++ b/config/nginx/navidrome.conf @@ -12,4 +12,5 @@ server { proxy_set_header X-Forwarded-Protocol $scheme; proxy_set_header X-Forwarded-Host $http_host; proxy_buffering off; + } }