Merge pull request #947 from Robbt/prevent-icecast-pass-change-during-upgrade

made sure that icecast pass is not changed upon upgrade or reprovision
This commit is contained in:
Kyle Robbertze 2020-01-09 16:42:58 +02:00 committed by GitHub
commit 3e8d20e1d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -906,7 +906,7 @@ if [ "$icecast" = "t" ]; then
icecast_config="/etc/icecast.xml"
fi
# only update icecast password if
if [ ! -f "/etc/airtime/airtime.conf" ]; then
if [ ! -f "/etc/airtime/airtime.conf" ] && [ !-f "/etc/airtime/airtime.conf.tmp" ]; 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."
@ -1120,7 +1120,7 @@ if [ ! -d "/etc/airtime" ]; then
mkdir /etc/airtime
fi
if [ ! -f "/etc/airtime/airtime.conf" ]; then
if [ ! -f "/etc/airtime/airtime.conf" ] && [ !-f "/etc/airtime/airtime.conf.tmp" ]; then
# need to copy the icecast_pass from temp to /etc/airtime so web-based installer can read it
cp /tmp/icecast_pass /etc/airtime/icecast_pass
fi