Made the process of switching from an old (pre-2.5.2) install to the new version smoother

This commit is contained in:
Duncan Sommerville 2015-01-15 13:48:40 -05:00
parent ee9163fa8e
commit 36c5d22e25
5 changed files with 58 additions and 47 deletions

47
install
View file

@ -233,30 +233,35 @@ echo "/ | \ || | \ | | | / Y \| \ "
echo "\____|__ /___||____|_ / |____| |___\____|__ /_______ / "
echo -e " \/ \/ \/ \/ \n"
if [ -f /etc/airtime/airtime.conf ]; then
set +e
verbose "Stopping airtime services..."
service airtime-playout stop-with-monit
service airtime-media-monitor stop-with-monit
service airtime-liquidsoap stop-with-monit
verbose "...Done"
OLD_CONF=$(grep "[media-monitor]" /etc/airtime/airtime.conf)
echo "Existing Airtime installation detected. Your current /etc/airtime/airtime.conf \
will be moved to /etc/airtime/airtime.conf.bak"
# If we don't remove the existing python files in /usr/lib and the
# /etc/init.d startup scripts, services won't work properly
rm -rf /usr/lib/airtime/
rm /etc/init.d/airtime-*
# If the user selects an "in-place" install or passes in a web root,
# we need to replace the old apache airtime.conf
rm /etc/apache2/sites-available/airtime.conf
if [ -d /usr/share/airtime -a web_root = /usr/share/airtime ]; then
rm -rf /usr/share/airtime
if [ -n "${OLD_CONF}" ]; then
set +e
verbose "Stopping airtime services..."
service airtime-playout stop-with-monit
service airtime-media-monitor stop-with-monit
service airtime-liquidsoap stop-with-monit
verbose "...Done"
echo "Looks like you have an old version of Airtime. Your current /etc/airtime/airtime.conf \
will be moved to /etc/airtime/airtime.conf.tmp"
# If we don't remove the existing python files in /usr/lib and the
# /etc/init.d startup scripts, services won't work properly
rm -rf /usr/lib/airtime/
rm /etc/init.d/airtime-*
# If the user selects an "in-place" install or passes in a web root,
# we need to replace the old apache airtime.conf
rm /etc/apache2/sites-available/airtime.conf
if [ -d /usr/share/airtime -a web_root = /usr/share/airtime ]; then
rm -rf /usr/share/airtime
fi
mv /etc/airtime/airtime.conf /etc/airtime/airtime.conf.tmp
set -e
fi
mv /etc/airtime/airtime.conf /etc/airtime/airtime.conf.bak
set -e
fi
if [ "$apache" = "f" -a ${_i} -eq 1 ]; then