Skip to content

Instantly share code, notes, and snippets.

@jamestomasino
Created March 10, 2018 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamestomasino/617cc532657556abd57807535ed55ac6 to your computer and use it in GitHub Desktop.
Save jamestomasino/617cc532657556abd57807535ed55ac6 to your computer and use it in GitHub Desktop.
Create stream to anonradio openmic (or local test) from any directory of mp3s
#!/usr/bin/env bash
find . -name "*.mp3" -print | sort > "tracks.pls"
if [[ "$1" == "openmic" ]]; then
liquidsoap 'output.icecast(%mp3(bitrate=192), host="anonradio.net", port=8010, user="openmic", password="<password>", mount="/openmic", mksafe(playlist.once("tracks.pls")))'
else
liquidsoap 'out(playlist.once("tracks.pls"))'
fi
function finish {
if [[ -f "tracks.pls" ]]; then
rm "tracks.pls"
fi
}
trap finish EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment