Merge pull request #933 from Robbt/icecast-password

change default icecast password automatically during install
This commit is contained in:
Kyle Robbertze 2020-01-08 13:50:56 +02:00 committed by GitHub
commit 5cfa57234b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 108 additions and 1 deletions

14
install
View file

@ -900,8 +900,19 @@ if [ "$icecast" = "t" ]; then
icecast_unit_name="icecast2"
if [ "$dist" != "centos" ]; then
sed -i 's/ENABLE=false/ENABLE=true/g' /etc/default/icecast2
icecast_config="/etc/icecast2/icecast.xml"
else
icecast_unit_name="icecast"
icecast_config="/etc/icecast.xml"
fi
# only update icecast password if
if [ ! -f "/etc/airtime/airtime.conf" ]; then
icecast_pass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-12};)
echo $icecast_pass > /tmp/icecast_pass
loud "\n New install detected setting icecast password to random value."
xmlstarlet ed --inplace -u /icecast/authentication/source-password -v $icecast_pass $icecast_config
xmlstarlet ed --inplace -u /icecast/authentication/relay-password -v $icecast_pass $icecast_config
xmlstarlet ed --inplace -u /icecast/authentication/admin-password -v $icecast_pass $icecast_config
fi
# restart in case icecast was already started (like is the case on debian)
systemInitCommand restart ${icecast_unit_name}
@ -1107,9 +1118,12 @@ if [ ! -d "/etc/airtime" ]; then
verbose "\n * Creating /etc/airtime/ directory..."
mkdir /etc/airtime
# need to copy the icecast_pass from temp to /etc/airtime so installer can read it
cp /tmp/icecast_pass /etc/airtime/icecast_pass
fi
chown -R ${web_user}:${web_user} /etc/airtime
if [ ! -d "/srv/airtime" ]; then