First working version

This commit is contained in:
2020-04-30 12:36:27 +02:00
parent 5d1a8bbd52
commit f18e948aad
8 changed files with 495 additions and 2 deletions

26
icecast-docker/entry.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
if [[ -z ${ICECAST_SOURCE_PW} ]]; then
ICECAST_SOURCE_PW=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 16)
echo "ICECAST_SOURCE_PW was not set. Generated a random one."
fi
if [[ -z ${ICECAST_RELAY_PW} ]]; then
ICECAST_RELAY_PW=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 16)
fi
if [[ -z ${ICECAST_ADMIN_PW} ]]; then
ICECAST_ADMIN_PW=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 16)
fi
echo "ICECAST_SOURCE_PW=${ICECAST_SOURCE_PW}"
sed -i "s/<source-password>.*<\/source-password>/<source-password>${ICECAST_SOURCE_PW}<\/source-password>/g" /etc/icecast2/icecast.xml
sed -i "s/<relay-password>.*<\/relay-password>/<relay-password>${ICECAST_RELAY_PW}<\/relay-password>/g" /etc/icecast2/icecast.xml
sed -i "s/<admin-password>.*<\/admin-password>/<admin-password>${ICECAST_ADMIN_PW}<\/admin-password>/g" /etc/icecast2/icecast.xml
sudo -Eu icecast2 icecast2 -c /etc/icecast2/icecast.xml