From 30a3d9ceab1ef4a2b7d897fee53221cee09ab6ec Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 1 Apr 2020 03:40:07 +0200 Subject: [PATCH 1/3] [fix] Backward compatibility for NC 14 or older --- scripts/upgrade | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8d109b4..77fd66e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -199,8 +199,15 @@ fi # Define a function to execute commands with `occ` exec_occ() { + # Backward compatibility to upgrade from NC14 or older version + if [ $current_major_version -gt 14 ] + then + NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION + else + NEXTCLOUD_PHP_VERSION="7.0" + fi (cd "$final_path" && exec_as "$app" \ - php$YNH_PHP_VERSION occ --no-interaction --no-ansi "$@") + php$NEXTCLOUD_PHP_VERSION occ --no-interaction --no-ansi "$@") } # Define a function to add an external storage From e821c6c06b89db4619d3355f35e6101dff15731f Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 1 Apr 2020 03:54:51 +0200 Subject: [PATCH 2/3] [fix] "last" don't pass correctly --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 77fd66e..895e79c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -200,11 +200,11 @@ fi # Define a function to execute commands with `occ` exec_occ() { # Backward compatibility to upgrade from NC14 or older version - if [ $current_major_version -gt 14 ] + if [ $current_major_version -lt 15 ] then - NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION - else NEXTCLOUD_PHP_VERSION="7.0" + else + NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION fi (cd "$final_path" && exec_as "$app" \ php$NEXTCLOUD_PHP_VERSION occ --no-interaction --no-ansi "$@") From de430e91acbe45eecd3aef6590c7ce762381fb6a Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 1 Apr 2020 12:23:19 +0200 Subject: [PATCH 3/3] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 895e79c..5d832b6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -204,7 +204,7 @@ exec_occ() { then NEXTCLOUD_PHP_VERSION="7.0" else - NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION + NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION fi (cd "$final_path" && exec_as "$app" \ php$NEXTCLOUD_PHP_VERSION occ --no-interaction --no-ansi "$@")