コード例 #1
0
ファイル: AirtimeIni.php プロジェクト: romansavrulin/Airtime
 /**
  * This function creates the /etc/airtime configuration folder
  * and copies the default config files to it.
  */
 public static function CreateIniFiles()
 {
     if (!file_exists("/etc/airtime/")) {
         if (!mkdir("/etc/airtime/", 0755, true)) {
             echo "Could not create /etc/airtime/ directory. Exiting.";
             exit(1);
         }
     }
     if (!copy(AirtimeInstall::GetAirtimeSrcDir() . "/build/airtime.conf", AirtimeIni::CONF_FILE_AIRTIME)) {
         echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
         exit(1);
     }
     if (!copy(__DIR__ . "/../../python_apps/api_clients/api_client.cfg", AirtimeIni::CONF_FILE_API_CLIENT)) {
         echo "Could not copy api_client.cfg to /etc/airtime/. Exiting.";
         exit(1);
     }
     if (!copy(__DIR__ . "/../../python_apps/pypo/pypo.cfg", AirtimeIni::CONF_FILE_PYPO)) {
         echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
         exit(1);
     }
     if (!copy(__DIR__ . "/../../python_apps/show-recorder/recorder.cfg", AirtimeIni::CONF_FILE_RECORDER)) {
         echo "Could not copy recorder.cfg to /etc/airtime/. Exiting.";
         exit(1);
     }
     if (!copy(__DIR__ . "/../../python_apps/pypo/liquidsoap_scripts/liquidsoap.cfg", AirtimeIni::CONF_FILE_LIQUIDSOAP)) {
         echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting.";
         exit(1);
     }
     if (!copy(__DIR__ . "/../../python_apps/media-monitor/media-monitor.cfg", AirtimeIni::CONF_FILE_MEDIAMONITOR)) {
         echo "Could not copy media-monitor.cfg to /etc/airtime/. Exiting.";
         exit(1);
     }
 }
コード例 #2
0
ファイル: AirtimeIni.php プロジェクト: nidzix/Airtime
 /**
  * This function creates the /etc/airtime configuration folder
  * and copies the default config files to it.
  */
 public static function CreateIniFiles()
 {
     if (!file_exists("/etc/airtime/")) {
         if (!mkdir("/etc/airtime/", 0755, true)) {
             echo "Could not create /etc/airtime/ directory. Exiting.";
             exit(1);
         }
     }
     if (!copy(AirtimeInstall::GetAirtimeSrcDir() . "/build/airtime.conf", AirtimeIni::CONF_FILE_AIRTIME)) {
         echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
         exit(1);
     } else {
         if (!self::ChangeFileOwnerGroupMod(AirtimeIni::CONF_FILE_AIRTIME, self::CONF_WWW_DATA_GRP)) {
             echo "Could not set ownership of api_client.cfg to 'pypo'. Exiting.";
             exit(1);
         }
     }
     if (getenv("python_service") == "0") {
         if (!copy(__DIR__ . "/../../python_apps/api_clients/api_client.cfg", AirtimeIni::CONF_FILE_API_CLIENT)) {
             echo "Could not copy api_client.cfg to /etc/airtime/. Exiting.";
             exit(1);
         } else {
             if (!self::ChangeFileOwnerGroupMod(AirtimeIni::CONF_FILE_API_CLIENT, self::CONF_PYPO_GRP)) {
                 echo "Could not set ownership of api_client.cfg to 'pypo'. Exiting.";
                 exit(1);
             }
         }
         if (!copy(__DIR__ . "/../../python_apps/pypo/pypo.cfg", AirtimeIni::CONF_FILE_PYPO)) {
             echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
             exit(1);
         } else {
             if (!self::ChangeFileOwnerGroupMod(AirtimeIni::CONF_FILE_PYPO, self::CONF_PYPO_GRP)) {
                 echo "Could not set ownership of pypo.cfg to 'pypo'. Exiting.";
                 exit(1);
             }
         }
         /*
                     if (!copy(__DIR__."/../../python_apps/pypo/liquidsoap_scripts/liquidsoap.cfg", AirtimeIni::CONF_FILE_LIQUIDSOAP)){
                         echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting.";
                         exit(1);
                     } else if (!self::ChangeFileOwnerGroupMod(AirtimeIni::CONF_FILE_LIQUIDSOAP, self::CONF_PYPO_GRP)){
                         echo "Could not set ownership of liquidsoap.cfg to 'pypo'. Exiting.";
                         exit(1);
                     }
                     * */
         if (!copy(__DIR__ . "/../../python_apps/media-monitor/media-monitor.cfg", AirtimeIni::CONF_FILE_MEDIAMONITOR)) {
             echo "Could not copy media-monitor.cfg to /etc/airtime/. Exiting.";
             exit(1);
         } else {
             if (!self::ChangeFileOwnerGroupMod(AirtimeIni::CONF_FILE_MEDIAMONITOR, self::CONF_PYPO_GRP)) {
                 echo "Could not set ownership of media-monitor.cfg to 'pypo'. Exiting.";
                 exit(1);
             }
         }
     }
 }
コード例 #3
0
ファイル: airtime-upgrade.php プロジェクト: nidzix/Airtime
/**
 * @package Airtime
 * @subpackage StorageServer
 * @copyright 2010 Sourcefabric O.P.S.
 * @license http://www.gnu.org/licenses/gpl.txt
 */
if (posix_geteuid() != 0) {
    echo "Must be root user.\n";
    exit(1);
}
require_once __DIR__ . '/airtime-constants.php';
require_once __DIR__ . '/AirtimeIni.php';
require_once __DIR__ . '/AirtimeInstall.php';
require_once 'propel/runtime/lib/Propel.php';
Propel::init(AirtimeInstall::GetAirtimeSrcDir() . "/application/configs/db-conf.php");
Propel::init(AirtimeInstall::GetAirtimeSrcDir() . "/application/configs/airtime-conf-production.php");
function pause()
{
    /* Type "sudo -s" to change to root user then type "export AIRTIME_INSTALL_DEBUG=1" and then
     * start airtime-install to enable this feature. Is used to pause between upgrade scripts
     * to examine the state of the system and see if everything is as expected. */
    if (getenv("AIRTIME_INSTALL_DEBUG") === "1") {
        echo "Press Enter to Continue" . PHP_EOL;
        fgets(STDIN);
    }
}
AirtimeInstall::DbConnect(true);
$con = Propel::getConnection();
$version = AirtimeInstall::GetVersionInstalled();
echo "******************************** Upgrade Begin *********************************" . PHP_EOL;
global $CC_CONFIG;
コード例 #4
0
 public static function InstallPhpCode()
 {
     $CC_CONFIG = Config::getConfig();
     echo "* Installing PHP code to " . AirtimeInstall::CONF_DIR_WWW . PHP_EOL;
     exec("mkdir -p " . AirtimeInstall::CONF_DIR_WWW);
     exec("cp -R " . AirtimeInstall::GetAirtimeSrcDir() . "/* " . AirtimeInstall::CONF_DIR_WWW);
 }
コード例 #5
0
    }
}
if ($overwrite) {
    echo "* Creating INI files" . PHP_EOL;
    AirtimeIni::CreateIniFiles();
}
AirtimeIni::CreateMonitFile();
AirtimeInstall::InstallPhpCode();
AirtimeInstall::InstallBinaries();
if ($overwrite) {
    echo "* Initializing INI files" . PHP_EOL;
    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;
AirtimeInstall::InstallStorageDirectory();
if ($db_install) {
    if ($newInstall) {
        // This is called with "system" so that we can pass in a parameter.  See the file itself
        // for why we need to do this.
        system('php ' . __DIR__ . '/airtime-db-install.php y');
        AirtimeInstall::DbConnect(true);
    } else {
        require_once 'airtime-db-install.php';
    }
}
AirtimeInstall::CreateSymlinksToUtils();
AirtimeInstall::CreateZendPhpLogFile();
AirtimeInstall::CreateCronFile();