Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
Conflicts: airtime_mvc/application/controllers/PreferenceController.php airtime_mvc/application/models/Preference.php
This commit is contained in:
commit
05dc48fa71
55 changed files with 907 additions and 664 deletions
|
@ -14,7 +14,7 @@ echo -e "\n******************************** Install Begin **********************
|
|||
echo -e "\n*** Creating Pypo User ***"
|
||||
python ${SCRIPTPATH}/../python_apps/create-pypo-user.py
|
||||
|
||||
php ${SCRIPTPATH}/airtime-install.php $@
|
||||
php ${SCRIPTPATH}/include/airtime-install.php $@
|
||||
|
||||
echo -e "\n*** Pypo Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-install.py
|
||||
|
@ -26,6 +26,7 @@ echo -e "\n*** Media Monitor Installation ***"
|
|||
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
||||
|
||||
sleep 4
|
||||
echo -e "\n*** Verifying your system environment ***"
|
||||
airtime-check-system
|
||||
|
||||
echo -e "\n******************************* Install Complete *******************************"
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Cause bash script to exit if any of the installers
|
||||
#return with a non-zero return value.
|
||||
set -e
|
||||
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
|
@ -7,8 +11,6 @@ SCRIPTPATH=`dirname $SCRIPT`
|
|||
|
||||
echo -e "\n******************************* Uninstall Begin ********************************"
|
||||
|
||||
php ${SCRIPTPATH}/airtime-uninstall.php
|
||||
|
||||
echo -e "\n*** Uninstalling Pypo ***"
|
||||
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-uninstall.py
|
||||
|
||||
|
@ -21,6 +23,9 @@ python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-uninstal
|
|||
echo -e "\n*** Removing Pypo User ***"
|
||||
python ${SCRIPTPATH}/../python_apps/remove-pypo-user.py
|
||||
|
||||
php ${SCRIPTPATH}/include/airtime-uninstall.php
|
||||
|
||||
|
||||
echo -e "\n****************************** Uninstall Complete ******************************\n"
|
||||
echo "NOTE: To fully remove all Airtime files, you will also have to manually delete"
|
||||
echo " the directories '/srv/airtime'(default storage location of media files)"
|
||||
|
|
|
@ -27,6 +27,7 @@ class AirtimeIni
|
|||
const CONF_FILE_RECORDER = "/etc/airtime/recorder.cfg";
|
||||
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
||||
const CONF_FILE_MONIT = "/etc/monit/conf.d/airtime-monit.cfg";
|
||||
|
||||
public static function IniFilesExist()
|
||||
{
|
||||
|
@ -75,10 +76,21 @@ class AirtimeIni
|
|||
exit(1);
|
||||
}
|
||||
if (!copy(__DIR__."/../../python_apps/media-monitor/media-monitor.cfg", AirtimeIni::CONF_FILE_MEDIAMONITOR)){
|
||||
echo "Could not copy MediaMonitor.cfg to /etc/airtime/. Exiting.";
|
||||
echo "Could not copy media-monitor.cfg to /etc/airtime/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function CreateMonitFile(){
|
||||
if (!copy(__DIR__."/../../python_apps/monit/airtime-monit.cfg", AirtimeIni::CONF_FILE_MONIT)){
|
||||
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function RemoveMonitFile(){
|
||||
@unlink("/etc/monit/conf.d/airtime-monit.cfg");
|
||||
}
|
||||
|
||||
/**
|
||||
* This function removes /etc/airtime and the configuration
|
||||
|
@ -187,7 +199,6 @@ class AirtimeIni
|
|||
AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_PYPO, 'api_key', "'$api_key'");
|
||||
AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_RECORDER, 'api_key', "'$api_key'");
|
||||
AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_MEDIAMONITOR, 'api_key', "'$api_key'");
|
||||
AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW.'/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW);
|
||||
}
|
||||
|
||||
public static function ReadPythonConfig($p_filename)
|
||||
|
|
|
@ -290,7 +290,7 @@ class AirtimeInstall
|
|||
|
||||
public static function DeleteFilesRecursive($p_path)
|
||||
{
|
||||
$command = "rm -rf $p_path";
|
||||
$command = "rm -rf \"$p_path\"";
|
||||
exec($command);
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ class AirtimeInstall
|
|||
public static function UninstallPhpCode()
|
||||
{
|
||||
echo "* Removing PHP code from ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL;
|
||||
exec("rm -rf ".AirtimeInstall::CONF_DIR_WWW);
|
||||
exec('rm -rf "'.AirtimeInstall::CONF_DIR_WWW.'"');
|
||||
}
|
||||
|
||||
public static function InstallBinaries()
|
||||
|
@ -349,7 +349,7 @@ class AirtimeInstall
|
|||
public static function UninstallBinaries()
|
||||
{
|
||||
echo "* Removing Airtime binaries from ".AirtimeInstall::CONF_DIR_BINARIES.PHP_EOL;
|
||||
exec("rm -rf ".AirtimeInstall::CONF_DIR_BINARIES);
|
||||
exec('rm -rf "'.AirtimeInstall::CONF_DIR_BINARIES.'"');
|
||||
}
|
||||
|
||||
public static function DirCheck()
|
||||
|
@ -399,6 +399,6 @@ class AirtimeInstall
|
|||
$path = AirtimeInstall::CONF_DIR_LOG;
|
||||
echo "* Removing logs directory ".$path.PHP_EOL;
|
||||
|
||||
exec("rm -rf $path");
|
||||
exec("rm -rf \"$path\"");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
* Performs a new install (new configs, database install) if a version of Airtime is not found
|
||||
* If the current version is found to be installed the User is presented with the help menu and can choose -r to reinstall.
|
||||
*/
|
||||
set_include_path(__DIR__.'/../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
||||
set_include_path(__DIR__.'/../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
|
||||
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
||||
require_once(dirname(__FILE__).'/AirtimeIni.php');
|
||||
require_once(dirname(__FILE__).'/AirtimeInstall.php');
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/constants.php');
|
||||
|
||||
AirtimeInstall::ExitIfNotRoot();
|
||||
|
@ -97,6 +97,8 @@ if ($overwrite) {
|
|||
echo "* Creating INI files".PHP_EOL;
|
||||
AirtimeIni::CreateIniFiles();
|
||||
}
|
||||
AirtimeIni::CreateMonitFile();
|
||||
|
||||
|
||||
AirtimeInstall::InstallPhpCode();
|
||||
AirtimeInstall::InstallBinaries();
|
||||
|
@ -106,6 +108,9 @@ if ($overwrite) {
|
|||
AirtimeIni::UpdateIniFiles();
|
||||
}
|
||||
|
||||
// Update the build.properties file to point to the correct directory.
|
||||
AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW.'/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW);
|
||||
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||
|
||||
echo "* Airtime Version: ".AIRTIME_VERSION.PHP_EOL;
|
|
@ -5,8 +5,8 @@
|
|||
* @license http://www.gnu.org/licenses/gpl.txt
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
|
||||
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
||||
require_once(dirname(__FILE__).'/AirtimeIni.php');
|
||||
require_once(dirname(__FILE__).'/AirtimeInstall.php');
|
||||
// Need to check that we are superuser before running this.
|
||||
AirtimeInstall::ExitIfNotRoot();
|
||||
|
||||
|
@ -69,7 +69,7 @@ if ($dbDeleteFailed) {
|
|||
// Delete the user
|
||||
//------------------------------------------------------------------------
|
||||
echo " * Deleting database user '{$CC_CONFIG['dsn']['username']}'...".PHP_EOL;
|
||||
$command = "echo \"DROP USER IF EXISTS {$CC_CONFIG['dsn']['username']}\" | su postgres -c psql";
|
||||
$command = "echo \"DROP USER IF EXISTS {$CC_CONFIG['dsn']['username']}\" | su postgres -c psql >/dev/null 2>&1";
|
||||
@exec($command, $output, $results);
|
||||
if ($results == 0) {
|
||||
echo " * User '{$CC_CONFIG['dsn']['username']}' deleted.".PHP_EOL;
|
||||
|
@ -88,6 +88,7 @@ if ($results == 0) {
|
|||
AirtimeInstall::RemoveSymlinks();
|
||||
AirtimeInstall::UninstallBinaries();
|
||||
AirtimeInstall::RemoveLogDirectories();
|
||||
AirtimeIni::RemoveMonitFile();
|
||||
|
||||
unlink('/etc/cron.d/airtime-crons');
|
||||
|
|
@ -7,8 +7,9 @@
|
|||
*/
|
||||
|
||||
//Pear classes.
|
||||
set_include_path(__DIR__.'/../airtime_mvc/library/pear' . PATH_SEPARATOR . get_include_path());
|
||||
set_include_path(__DIR__.'/../../airtime_mvc/library/pear' . PATH_SEPARATOR . get_include_path());
|
||||
require_once('DB.php');
|
||||
require_once(dirname(__FILE__).'/AirtimeIni.php');
|
||||
|
||||
if(exec("whoami") != "root"){
|
||||
echo "Must be root user.\n";
|
||||
|
@ -67,19 +68,19 @@ echo "******************************** Update Begin ****************************
|
|||
$version = substr($version, 0, 5);
|
||||
|
||||
if (strcmp($version, "1.7.0") < 0){
|
||||
system("php ".__DIR__."/upgrades/airtime-1.7/airtime-upgrade.php");
|
||||
system("php ".__DIR__."/../upgrades/airtime-1.7/airtime-upgrade.php");
|
||||
}
|
||||
if (strcmp($version, "1.8.0") < 0){
|
||||
system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
|
||||
system("php ".__DIR__."/../upgrades/airtime-1.8/airtime-upgrade.php");
|
||||
}
|
||||
if (strcmp($version, "1.8.1") < 0){
|
||||
system("php ".__DIR__."/upgrades/airtime-1.8.1/airtime-upgrade.php");
|
||||
system("php ".__DIR__."/../upgrades/airtime-1.8.1/airtime-upgrade.php");
|
||||
}
|
||||
if (strcmp($version, "1.8.2") < 0){
|
||||
system("php ".__DIR__."/upgrades/airtime-1.8.2/airtime-upgrade.php");
|
||||
system("php ".__DIR__."/../upgrades/airtime-1.8.2/airtime-upgrade.php");
|
||||
}
|
||||
if (strcmp($version, "1.9.0") < 0){
|
||||
system("php ".__DIR__."/upgrades/airtime-1.9/airtime-upgrade.php");
|
||||
system("php ".__DIR__."/../upgrades/airtime-1.9/airtime-upgrade.php");
|
||||
}
|
||||
|
||||
|
||||
|
@ -91,13 +92,15 @@ $CC_DBC->query($sql);
|
|||
|
||||
|
||||
echo PHP_EOL."*** Updating Pypo ***".PHP_EOL;
|
||||
passthru("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py");
|
||||
passthru("python ".__DIR__."/../../python_apps/pypo/install/pypo-install.py");
|
||||
|
||||
echo PHP_EOL."*** Updating Recorder ***".PHP_EOL;
|
||||
passthru("python ".__DIR__."/../python_apps/show-recorder/install/recorder-install.py");
|
||||
passthru("python ".__DIR__."/../../python_apps/show-recorder/install/recorder-install.py");
|
||||
|
||||
echo PHP_EOL."*** Starting Media Monitor ***".PHP_EOL;
|
||||
passthru("python ".__DIR__."/../python_apps/media-monitor/install/media-monitor-install.py");
|
||||
echo PHP_EOL."*** Updating Media Monitor ***".PHP_EOL;
|
||||
passthru("python ".__DIR__."/../../python_apps/media-monitor/install/media-monitor-install.py");
|
||||
|
||||
AirtimeIni::CreateMonitFile();
|
||||
|
||||
|
||||
echo "******************************* Update Complete *******************************".PHP_EOL;
|
|
@ -39,7 +39,7 @@ function InstallBinaries()
|
|||
function UninstallBinaries()
|
||||
{
|
||||
echo "* Removing Airtime binaries from ".CONF_DIR_BINARIES.PHP_EOL;
|
||||
exec("rm -rf ".CONF_DIR_BINARIES);
|
||||
exec('rm -rf "'.CONF_DIR_BINARIES.'"');
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,7 +74,7 @@ $pathnames = array("/usr/bin/airtime-pypo-start",
|
|||
|
||||
foreach ($pathnames as $pn){
|
||||
echo "Removing $pn\n";
|
||||
exec("rm -rf ".$pn);
|
||||
exec("rm -rf \"$pn\"");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue