-fixed uninstall script
This commit is contained in:
parent
6f0b4e64f8
commit
616b85ddef
|
@ -27,24 +27,11 @@ echo "***************************\n";
|
||||||
|
|
||||||
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||||
require_once(dirname(__FILE__).'/installInit.php');
|
require_once(dirname(__FILE__).'/installInit.php');
|
||||||
//require_once(dirname(__FILE__).'/../backend/cron/Cron.php');
|
|
||||||
|
|
||||||
function airtime_uninstall_delete_files($p_path)
|
function airtime_uninstall_delete_files($p_path)
|
||||||
{
|
{
|
||||||
if (!empty($p_path) && (strlen($p_path) > 4)) {
|
$command = "rm -rf $p_path";
|
||||||
if (file_exists($p_path)) {
|
exec($command);
|
||||||
$dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($p_path), RecursiveIteratorIterator::CHILD_FIRST);
|
|
||||||
|
|
||||||
for ($dir->rewind(); $dir->valid(); $dir->next()) {
|
|
||||||
if ($dir->isDir()) {
|
|
||||||
rmdir($dir->getPathname());
|
|
||||||
} else {
|
|
||||||
unlink($dir->getPathname());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rmdir($p_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
@ -212,10 +199,6 @@ foreach ($cron->ct->getByType(CRON_CMD) as $id => $line) {
|
||||||
$cron->closeCrontab();
|
$cron->closeCrontab();
|
||||||
echo "done.\n";
|
echo "done.\n";
|
||||||
*/
|
*/
|
||||||
//------------------------------------------------------------------------
|
|
||||||
// Delete files
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
airtime_uninstall_delete_files($CC_CONFIG['storageDir']);
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
@ -236,6 +219,13 @@ if ($results == 0) {
|
||||||
echo " * Nothing to delete..\n";
|
echo " * Nothing to delete..\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
// Delete files
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
airtime_uninstall_delete_files($CC_CONFIG['storageDir']);
|
||||||
|
|
||||||
|
|
||||||
echo "************************************\n";
|
echo "************************************\n";
|
||||||
echo "* StorageServer Uninstall Complete *\n";
|
echo "* StorageServer Uninstall Complete *\n";
|
||||||
echo "************************************\n";
|
echo "************************************\n";
|
Loading…
Reference in New Issue