first stab at icecast password change on install

This commit is contained in:
Robb Ebright 2020-01-01 21:03:30 -05:00
parent 1c2906f5ab
commit 5d3295c86c
9 changed files with 44 additions and 0 deletions

View file

@ -894,6 +894,12 @@ if [ "$icecast" = "t" ]; then
else
icecast_unit_name="icecast"
fi
icecast_pass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-12};echo;)
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"
@ -1100,6 +1106,9 @@ if [ ! -d "/etc/airtime" ]; then
mkdir /etc/airtime
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