From e842121c3b9c9f3da21b2195898e10d7f33af694 Mon Sep 17 00:00:00 2001 From: ljm42 Date: Tue, 19 Sep 2023 16:49:03 -0700 Subject: [PATCH] Improve Downgrade process --- emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php | 3 +++ sbin/upgrade | 2 ++ 2 files changed, 5 insertions(+) diff --git a/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php b/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php index ecf97df96..a3a92ba2a 100644 --- a/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php +++ b/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php @@ -20,6 +20,9 @@ require_once "$docroot/webGui/include/Secure.php"; $_SERVER['REQUEST_URI'] = 'plugins'; require_once "$docroot/webGui/include/Translations.php"; +$tmpdir="/boot/deletemedowngrade.".uniqid(); +mkdir($tmpdir); +exec("mv -f /boot/bz* $tmpdir"); exec("mv -f /boot/previous/* /boot"); $version = unscript(_var($_GET,'version')); file_put_contents("$docroot/plugins/unRAIDServer/README.md","**"._('DOWNGRADE TO VERSION')." $version**"); diff --git a/sbin/upgrade b/sbin/upgrade index 17c36c3e3..b22c109e7 100755 --- a/sbin/upgrade +++ b/sbin/upgrade @@ -38,3 +38,5 @@ mkdir -p "$CFG_NEW" # stating with 6.10 'USE_SSL="auto"' without a LE cert is invalid [[ ! -f /boot/config/ssl/certs/certificate_bundle.pem ]] && sed -i s/USE_SSL=\"auto\"/USE_SSL=\"no\"/ /boot/config/ident.cfg +# delete any temp dir left over from a version downgrade (see dynamix.plugin.manager/include/Downgrade.php) +rm -rf /boot/deletemedowngrade.*