Fix to upgrade path

This commit is contained in:
Duncan Sommerville 2015-03-25 12:03:01 -04:00
parent 0a3d8ea515
commit 47f7ad2e98
4 changed files with 12 additions and 7 deletions

View File

@ -1,7 +1,5 @@
<?php <?php
require_once("Upgrades.php");
class UpgradeController extends Zend_Controller_Action class UpgradeController extends Zend_Controller_Action
{ {
public function indexAction() public function indexAction()

View File

@ -30,7 +30,7 @@ class UpgradeManager
array_push($upgraders, new AirtimeUpgrader253()); array_push($upgraders, new AirtimeUpgrader253());
array_push($upgraders, new AirtimeUpgrader254()); array_push($upgraders, new AirtimeUpgrader254());
*/ */
return $upgradeManager->runUpgrades(array(new AirtimeUpgrader252()), (__DIR__ . "/controllers")); return $upgradeManager->runUpgrades(array(new AirtimeUpgrader252()), (dirname(__DIR__) . "/controllers"));
} }
/** /**

View File

@ -386,8 +386,10 @@ if [ "$apache" = "t" ]; then
if [ "$apacheversion" != "1" ]; then if [ "$apacheversion" != "1" ]; then
airtimeconfigfile="airtime.conf" airtimeconfigfile="airtime.conf"
oldconfigfile="airtime-vhost.conf"
else else
airtimeconfigfile="airtime" airtimeconfigfile="airtime"
oldconfigfile="airtime-vhost"
fi fi
# If we're upgrading (installing over an existing Airtime install) and we've been told to # If we're upgrading (installing over an existing Airtime install) and we've been told to
@ -403,6 +405,11 @@ if [ "$apache" = "t" ]; then
sed -e "s@WEB_ROOT@${web_root}@g" ${SCRIPT_DIR}/installer/apache/airtime-vhost > /etc/apache2/sites-available/${airtimeconfigfile} sed -e "s@WEB_ROOT@${web_root}@g" ${SCRIPT_DIR}/installer/apache/airtime-vhost > /etc/apache2/sites-available/${airtimeconfigfile}
fi fi
loudCmd "a2dissite 000-default" loudCmd "a2dissite 000-default"
# If Airtime was previously installed with apt, the vhost file name is different,
# so we need to specifically disable it.
if [ -f "/etc/apache2/sites-available/${oldconfigfile}" ]; then
loudCmd "a2dissite airtime-vhost"
fi
loudCmd "a2ensite airtime" loudCmd "a2ensite airtime"
else else
verbose "\nApache config for Airtime already exists, skipping" verbose "\nApache config for Airtime already exists, skipping"

View File

@ -71,16 +71,16 @@ echo "pip airtime-media-monitor"
echo -e "\nIf your web root is not listed, you will need to manually remove it." echo -e "\nIf your web root is not listed, you will need to manually remove it."
echo -e "\nThis will *permanently* remove Airtime and all related files from your computer. \ echo -e "\nThis will *permanently* remove Airtime and all related files from your computer. \
Any files in Airtime directories and subdirectories will be deleted. Are you sure you want to proceed? (Y/n): \c" Any files in Airtime directories and subdirectories will be deleted. Are you sure you want to proceed? [y/N]: \c"
read IN read IN
if [[ ! ( "$IN" = "y" || "$IN" = "Y" ) ]]; then if [[ ! ( "$IN" = "y" || "$IN" = "Y" ) ]]; then
exit 0 exit 0
fi fi
if [ -n "${STOR_DIR}" ]; then if [ -n "${STOR_DIR}" ]; then
echo -e "\nAre you sure you want to remove your music storage directory ${STOR_DIR} and all of its subdirectories? (Y/n): \c" echo -e "\nDo you want to remove your music storage directory ${STOR_DIR} and all of its subdirectories? [y/N]: \c"
read IN read IN
if [[ "$IN" = "y" || "$IN" = "Y" ]]; then if [[ ( "$IN" = "y" || "$IN" = "Y" ) ]]; then
rm -rf ${STOR_DIR} rm -rf ${STOR_DIR}
fi fi
else else
@ -94,7 +94,7 @@ for i in ${FILES[*]}; do
rm -rf $i rm -rf $i
done done
echo -e "\nDo you want to drop your current Airtime database? (Y/n): \c" echo -e "\nDo you want to drop your current Airtime database? [y/N]: \c"
read IN read IN
if [[ "$IN" = "y" || "$IN" = "Y" ]]; then if [[ "$IN" = "y" || "$IN" = "Y" ]]; then
echo -e "\nDropping Airtime database..." echo -e "\nDropping Airtime database..."