3 DIR=$(dirname $(readlink -f $0))
5 ICE_PORT=${ICEPORT:-8001}
6 MPD_PORT=${MPDPORT:-6601}
7 LISTEN=${LISTEN:-127.0.0.1}
10 set -o xtrace -o nounset
13 # Get the latest icecast conf
14 docker run --rm sima -v ${DIR}:/tmp/ debian:latest cp -f /icecast/icecast.xml /tmp/current.icecast.conf.xml
19 docker exec -ti sima /usr/bin/tail -F /var/log/icecast2/access.log /var/log/icecast2/error.log
23 # Build image with icecast
24 docker build -t kaliko/sima ${DIR}/sima
29 test -z "${MUSIC}" && { echo "Need a music directory to mount please set MUSIC var"; exit 1; }
30 docker ps -a | grep 'sima'
31 if [ "$?" -ne 0 ]; then
32 echo 'launching a new sima container'
33 local options="-p ${LISTEN}:${ICE_PORT}:8000"
34 options="${options} -p ${LISTEN}:${MPD_PORT}:6600"
35 options="${options} --volume ${MUSIC}:/var/lib/mpd/music:ro"
36 docker run ${options} --detach=true --name sima kaliko/sima
38 echo 'running the current sima container'