From 336e7d82b19165bb76c2e051cc9b2edb5721ed6a Mon Sep 17 00:00:00 2001 From: Robb Ebright Date: Tue, 7 Jan 2020 10:40:30 -0500 Subject: [PATCH] fixed installer to not change pass during upgrade and add centos support --- install | 21 +++++++++++++-------- installer/vagrant/centos.sh | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/install b/install index 897adae30..b64b12621 100755 --- a/install +++ b/install @@ -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 diff --git a/installer/vagrant/centos.sh b/installer/vagrant/centos.sh index fdff0dd5f..ed3b0bf70 100644 --- a/installer/vagrant/centos.sh +++ b/installer/vagrant/centos.sh @@ -86,7 +86,7 @@ yum install -y \ policycoreutils-python \ python-celery \ python2-pika \ - lsof \ + lsof \ xmlstarlet # for pip ssl install