fixed installer to not change pass during upgrade and add centos support

This commit is contained in:
Robb Ebright 2020-01-07 10:40:30 -05:00
parent f42f331c29
commit 336e7d82b1
2 changed files with 14 additions and 9 deletions

21
install
View File

@ -891,15 +891,20 @@ 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
icecast_pass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-12};)
echo $icecast_pass > /tmp/icecast_pass
xmlstarlet ed --inplace -u /icecast/authentication/source-password -v $icecast_pass /etc/icecast2/icecast.xml
xmlstarlet ed --inplace -u /icecast/authentication/relay-password -v $icecast_pass /etc/icecast2/icecast.xml
xmlstarlet ed --inplace -u /icecast/authentication/admin-password -v $icecast_pass /etc/icecast2/icecast.xml
# restart in case icecast was already started (like is the case on debian)
systemInitCommand restart ${icecast_unit_name}
verbose "...Done"
@ -1104,10 +1109,10 @@ 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
# need to copy the icecast_pass from temp to /etc/airtime so installer can read it
cp /tmp/icecast_pass /etc/airtime/icecast_pass
chown -R ${web_user}:${web_user} /etc/airtime

View File

@ -86,7 +86,7 @@ yum install -y \
policycoreutils-python \
python-celery \
python2-pika \
lsof \
lsof \
xmlstarlet
# for pip ssl install