diff --git a/install/installInit.php b/install/installInit.php index f906eb464..cef850345 100644 --- a/install/installInit.php +++ b/install/installInit.php @@ -3,8 +3,9 @@ if (!function_exists('pg_connect')) { trigger_error("PostgreSQL PHP extension required and not found.", E_USER_ERROR); exit(2); } -require_once('DB.php'); -require_once('File/Find.php'); +//require_once('DB.php'); +require_once(dirname(__FILE__).'/../library/pear/DB.php'); +//require_once('File/Find.php'); function camp_db_table_exists($p_name) { @@ -84,4 +85,4 @@ function install_setDirPermissions($filePath) { // } } -?> \ No newline at end of file +?> diff --git a/install/propel-install.php b/install/propel-install.php index bb02baeaf..f14ef8490 100644 --- a/install/propel-install.php +++ b/install/propel-install.php @@ -142,7 +142,7 @@ Subjects::AddSubjectToGroup('scheduler', $CC_CONFIG['StationPrefsGr']); // Install storage directories //------------------------------------------------------------------------ echo " *** Directory Setup ***\n"; -foreach (array('baseFilesDir', 'storageDir', /*'bufferDir', 'transDir', 'accessDir',*/ 'cronDir') as $d) { +foreach (array('baseFilesDir', 'storageDir') as $d) { $test = file_exists($CC_CONFIG[$d]); if ( $test === FALSE ) { @mkdir($CC_CONFIG[$d], 02775); diff --git a/install/uninstall.php b/install/uninstall.php index 7a2fef3cf..89da9bfed 100644 --- a/install/uninstall.php +++ b/install/uninstall.php @@ -14,16 +14,22 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) { exit; } +// Need to check that we are superuser before running this. +if(exec("whoami") != "root"){ + echo "Must be root user.\n"; + exit(1); +} + echo "***************************\n"; echo "* StorageServer Uninstall *\n"; echo "***************************\n"; -require_once(dirname(__FILE__).'/../conf.php'); +require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/installInit.php'); -require_once(dirname(__FILE__).'/../backend/cron/Cron.php'); +//require_once(dirname(__FILE__).'/../backend/cron/Cron.php'); -function camp_uninstall_delete_files($p_path) +function airtime_uninstall_delete_files($p_path) { if (!empty($p_path) && (strlen($p_path) > 4)) { if (file_exists($p_path)) { @@ -49,7 +55,6 @@ function camp_uninstall_delete_files($p_path) //------------------------------------------------------------------------ echo " * Dropping the database '".$CC_CONFIG['dsn']['database']."'...\n"; $command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']} 2> /dev/null"; -//$command = "sudo -u postgres dropdb {$CC_CONFIG['dsn']['database']}"; @exec($command, $output, $dbDeleteFailed); //------------------------------------------------------------------------ @@ -187,6 +192,7 @@ if ($dbDeleteFailed) { //------------------------------------------------------------------------ // Uninstall Cron job //------------------------------------------------------------------------ +/* $old_regex = '/transportCron\.php/'; echo " * Uninstalling cron job..."; @@ -205,13 +211,11 @@ foreach ($cron->ct->getByType(CRON_CMD) as $id => $line) { } $cron->closeCrontab(); echo "done.\n"; - +*/ //------------------------------------------------------------------------ // Delete files //------------------------------------------------------------------------ -camp_uninstall_delete_files($CC_CONFIG['storageDir']); -camp_uninstall_delete_files($CC_CONFIG['transDir']); -camp_uninstall_delete_files($CC_CONFIG['accessDir']); +airtime_uninstall_delete_files($CC_CONFIG['storageDir']); //------------------------------------------------------------------------