#!/bin/bash # Runs icecast2 and liquidsoap together (liquidsoap feeds icecast over # localhost). Bare envsubst: an unset variable becomes "", including passwords. # If either daemon exits the container exits 1, so restart: always recycles it. set -e envsubst < /etc/icecast2/icecast.xml.template > /etc/icecast2/icecast.xml envsubst < /etc/liquidsoap/stream.liq.template > /etc/liquidsoap/stream.liq icecast2 -c /etc/icecast2/icecast.xml & # Give icecast time to bind before liquidsoap tries to connect as a source. sleep 2 liquidsoap /etc/liquidsoap/stream.liq & # Exit as soon as either daemon dies, then take the other down with it. wait -n kill $(jobs -p) 2>/dev/null || true exit 1