diff --git a/install/froxlor.sql.php b/install/froxlor.sql.php index 81cb1a10..eb05ea49 100644 --- a/install/froxlor.sql.php +++ b/install/froxlor.sql.php @@ -678,7 +678,7 @@ opcache.validate_timestamps'), ('system', 'distribution', ''), ('system', 'update_channel', 'stable'), ('system', 'updatecheck_data', ''), - ('system', 'update_notify_last', '2.1.1'), + ('system', 'update_notify_last', ''), ('system', 'traffictool', 'goaccess'), ('system', 'req_limit_per_interval', 60), ('system', 'req_limit_interval', 60), @@ -727,7 +727,7 @@ opcache.validate_timestamps'), ('panel', 'settings_mode', '0'), ('panel', 'menu_collapsed', '1'), ('panel', 'version', '2.1.1'), - ('panel', 'db_version', '202312050'); + ('panel', 'db_version', '202312100'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/updates/froxlor/update_2.1.inc.php b/install/updates/froxlor/update_2.1.inc.php index 24a70fa3..07f96d00 100644 --- a/install/updates/froxlor/update_2.1.inc.php +++ b/install/updates/froxlor/update_2.1.inc.php @@ -213,3 +213,43 @@ if (Froxlor::isFroxlorVersion('2.1.0')) { Update::showUpdateStep("Updating from 2.1.0 to 2.1.1", false); Froxlor::updateToVersion('2.1.1'); } + +if (Froxlor::isDatabaseVersion('202312050')) { + Update::showUpdateStep("Cleaning up old files"); + $to_clean = array( + "lib/configfiles/centos7.xml", + "lib/configfiles/centos8.xml", + "lib/configfiles/stretch.xml", + "lib/configfiles/xenial.xml", + "lib/configfiles/buster.xml", + "lib/configfiles/bionic.xml", + ); + $disabled = explode(',', ini_get('disable_functions')); + $exec_allowed = !in_array('exec', $disabled); + $del_list = ""; + foreach ($to_clean as $filedir) { + $complete_filedir = Froxlor::getInstallDir() . $filedir; + if (file_exists($complete_filedir)) { + if ($exec_allowed) { + FileDir::safe_exec("rm -rf " . escapeshellarg($complete_filedir)); + } else { + $del_list .= "rm -rf " . escapeshellarg($complete_filedir) . PHP_EOL; + } + } + } + if ($exec_allowed) { + Update::lastStepStatus(0); + } else { + if (empty($del_list)) { + // none of the files existed + Update::lastStepStatus(0); + } else { + Update::lastStepStatus( + 1, + 'manual commands needed', + 'Please run the following commands manually:
' . $del_list . '
' + ); + } + } + Froxlor::updateToDbVersion('202312100'); +} diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 1c6ae69e..88d6a6e6 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -34,7 +34,7 @@ final class Froxlor const VERSION = '2.1.1'; // Database version (YYYYMMDDC where C is a daily counter) - const DBVERSION = '202312050'; + const DBVERSION = '202312100'; // Distribution branding-tag (used for Debian etc.) const BRANDING = '';