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

View File

@ -1,4 +1,9 @@
<?php <?php
$tempConfigPath = "/etc/airtime/airtime.conf.tmp";
if (file_exists($tempConfigPath)) {
$airtimeConfig = parse_ini_file($tempConfigPath, true);
$db = $airtimeConfig["database"];
}
?> ?>
<form action="#" role="form" id="dbSettingsForm"> <form action="#" role="form" id="dbSettingsForm">
@ -10,22 +15,26 @@
</p> </p>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="dbUser">Username</label> <label class="control-label" for="dbUser">Username</label>
<input required class="form-control" type="text" name="dbUser" id="dbUser" placeholder="Username" value="airtime"/> <input required class="form-control" type="text" name="dbUser" id="dbUser" placeholder="Username"
value=<?php echo (isset($db) ? $db["dbuser"] : "airtime"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="dbPass">Password</label> <label class="control-label" for="dbPass">Password</label>
<input required class="form-control" type="password" name="dbPass" id="dbPass" placeholder="Password" value="airtime"/> <input required class="form-control" type="password" name="dbPass" id="dbPass" placeholder="Password"
value=<?php echo (isset($db) ? $db["dbpass"] : "airtime"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="dbName">Name</label> <label class="control-label" for="dbName">Name</label>
<input required class="form-control" type="text" name="dbName" id="dbName" placeholder="Name" value="airtime"/> <input required class="form-control" type="text" name="dbName" id="dbName" placeholder="Name"
value=<?php echo (isset($db) ? $db["dbname"] : "airtime"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="dbHost">Host</label> <label class="control-label" for="dbHost">Host</label>
<input required class="form-control" type="text" name="dbHost" id="dbHost" placeholder="Host" value="localhost"/> <input required class="form-control" type="text" name="dbHost" id="dbHost" placeholder="Host"
value=<?php echo (isset($db) ? $db["host"] : "localhost"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<input class="form-control" type="hidden" name="dbErr" id="dbErr" aria-describedby="helpBlock"/> <input class="form-control" type="hidden" name="dbErr" id="dbErr" aria-describedby="helpBlock"/>

View File

@ -1,4 +1,8 @@
<?php <?php
$tempConfigPath = "/etc/airtime/airtime.conf.tmp";
if (file_exists($tempConfigPath)) {
rename($tempConfigPath, "/etc/airtime/airtime.conf.bak");
}
?> ?>
<form action="#" role="form" id="finishSettingsForm"> <form action="#" role="form" id="finishSettingsForm">

View File

@ -1,4 +1,9 @@
<?php <?php
$tempConfigPath = "/etc/airtime/airtime.conf.tmp";
if (file_exists($tempConfigPath)) {
$airtimeConfig = parse_ini_file($tempConfigPath, true);
$rmq = $airtimeConfig["rabbitmq"];
}
?> ?>
<form action="#" role="form" id="rmqSettingsForm"> <form action="#" role="form" id="rmqSettingsForm">
@ -19,12 +24,14 @@
<div id="rmqFormBody"> <div id="rmqFormBody">
<div class="form-group"> <div class="form-group">
<label class="control-label" for="rmqUser">Username</label> <label class="control-label" for="rmqUser">Username</label>
<input required class="form-control" type="text" name="rmqUser" id="rmqUser" placeholder="Username" value="airtime"/> <input required class="form-control" type="text" name="rmqUser" id="rmqUser" placeholder="Username"
value=<?php echo (isset($rmq) ? $rmq["user"] : "airtime"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="rmqPass">Password</label> <label class="control-label" for="rmqPass">Password</label>
<input class="form-control" type="password" name="rmqPass" id="rmqPass" placeholder="Password" value="airtime"/> <input class="form-control" type="password" name="rmqPass" id="rmqPass" placeholder="Password"
value=<?php echo (isset($rmq) ? $rmq["password"] : "airtime"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
<span id="rmqHelpBlock" class="help-block"> <span id="rmqHelpBlock" class="help-block">
You probably want to change this! You probably want to change this!
@ -32,17 +39,20 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="rmqHost">Host</label> <label class="control-label" for="rmqHost">Host</label>
<input required class="form-control" type="text" name="rmqHost" id="rmqHost" placeholder="Host" value="127.0.0.1"/> <input required class="form-control" type="text" name="rmqHost" id="rmqHost" placeholder="Host"
value=<?php echo (isset($rmq) ? $rmq["host"] : "127.0.0.1"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="rmqPort">Port</label> <label class="control-label" for="rmqPort">Port</label>
<input required class="form-control" type="text" name="rmqPort" id="rmqPort" placeholder="Port" value="5672"/> <input required class="form-control" type="text" name="rmqPort" id="rmqPort" placeholder="Port"
value=<?php echo (isset($rmq) ? $rmq["port"] : "5672"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="rmqVHost">Virtual Host</label> <label class="control-label" for="rmqVHost">Virtual Host</label>
<input required class="form-control" type="text" name="rmqVHost" id="rmqVHost" placeholder="VHost" value="/airtime"/> <input required class="form-control" type="text" name="rmqVHost" id="rmqVHost" placeholder="VHost"
value=<?php echo (isset($rmq) ? $rmq["vhost"] : "/airtime"); ?>/>
<span class="glyphicon glyphicon-remove form-control-feedback"></span> <span class="glyphicon glyphicon-remove form-control-feedback"></span>
</div> </div>
<input class="form-control" type="hidden" name="rmqErr" id="rmqErr" aria-describedby="helpBlock"/> <input class="form-control" type="hidden" name="rmqErr" id="rmqErr" aria-describedby="helpBlock"/>

View File

@ -107,23 +107,6 @@ vhost = /airtime
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# M O N I T
# ----------------------------------------------------------------------
#
# monit_user: The username for the Monit user.
# The default is guest.
#
# monit_password: The password for the Monit user.
# The default is airtime.
#
[monit]
monit_user = guest
monit_password = airtime
#
# ----------------------------------------------------------------------
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# M E D I A M O N I T O R # M E D I A M O N I T O R
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------

47
install
View File

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