diff --git a/scripts/upgrade b/scripts/upgrade index 6c54ca5..d0c6329 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -176,6 +176,8 @@ do # then it's the last upgrade to do if [ "$major_version" -eq "$current_major_version" ]; then current_major_version=last + # Execute the commands dedicated to the last upgrade + last_upgrade_operations fi # Load the value for this version diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 2bed20b..e061d31 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -6,8 +6,11 @@ next_version="15.0.0" # Nextcloud tarball checksum sha256 nextcloud_source_sha256="5bb0c58171353da844019b64080c21078002a59ab956ab72adb958844a98eb78" -# Patch nextcloud files only for the last version -cp -a ../sources/patches_last_version/* ../sources/patches +# This function will only be executed upon applying the last upgrade referenced above +last_upgrade_operations () { + # Patch nextcloud files only for the last version + cp -a ../sources/patches_last_version/* ../sources/patches -# Execute post-upgrade operations later on -(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u nextcloud php occ db:add-missing-indices ; sudo -u nextcloud php occ db:convert-filecache-bigint -n) > /tmp/nextcloud_maintenance.log") + # Execute post-upgrade operations later on + (cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u nextcloud php occ db:add-missing-indices ; sudo -u nextcloud php occ db:convert-filecache-bigint -n) > /tmp/nextcloud_maintenance.log") +}