#!/bin/sh # # Stream data to the test mountpoint, using 'ices2'. # stream=${1:-/stream.ogg} # Download a couple of test songs. for song in song1.ogg song2.ogg ; do test -e /vagrant/${song} || wget -O /vagrant/${song} http://www.incal.net/ale/test-songs/${song} done # Install Ices2. sudo apt-get -q -y install ices2 # Create the Ices2 config file. username=$(radioctl show-mount ${stream} | awk -F= '/^username/ {print $2}') password=$(radioctl show-mount ${stream} | awk -F= '/^password/ {print $2}') if [ -z "${username}" ]; then echo "ERROR: stream ${stream} not found" exit 1 fi sed -e s/@USERNAME@/${username}/ -e s/@PASSWORD@/${password}/ \ < /vagrant/ices.xml.tmpl > /tmp/ices.xml cat > /tmp/ices-playlist.txt <<EOF /vagrant/song1.ogg /vagrant/song2.ogg EOF cd /tmp ices2 /tmp/ices.xml >/tmp/ices.log 2>&1 &