Files
docker-mopidy-iris/root/usr/local/bin/entrypoint.sh
Nick Stokoe 50a2f65917 root/usr/local/bin/entrypoint.sh - WIP disable icecast, always copy configs
We don't want the config to be untouched if we change it here, just
because it exists in some form already.
2021-02-19 11:03:56 +00:00

25 lines
895 B
Bash
Executable File

#!/bin/sh
set -euo pipefail
[ ! -r /data/.config ] && mkdir -p /data/.config
[ ! -r /data/.images ] && mkdir -p /data/.images
#[ ! -r /data/.config/mopidy.conf ] && cp /defaults/mopidy.conf /data/.config
#[ ! -r /data/.config/icecast.xml ] && cp /defaults/icecast.xml /data/.config
cp -f /defaults/mopidy.conf /defaults/icecast.xml /data/.config
if [ ! -r /data/icecast/web ] || [ ! -r /data/icecast/admin ] || [ ! -r /data/icecast/logs ]; then
mkdir -p /data/icecast/web /data/icecast/admin /data/icecast/logs
cp -r /usr/share/icecast /data/icecast
cp /defaults/silence.mp3 /data/icecast/web/silence.mp3
fi
chown -R mopidy:mopidy /data
#su-exec mopidy mopidy --config /data/.config/mopidy.conf local scan
#trap "kill $PID" HUP INT TERM
#su-exec mopidy icecast -c /data/.config/icecast.xml -b &
su-exec mopidy mopidy --config /data/.config/mopidy.conf "${@}"
#PID=$!
#wait $PID