From 892c8edfcc77c29f7fe5b55964281e002a72f471 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Sat, 8 Jul 2023 08:00:57 +0200 Subject: [PATCH] Remove extra function Signed-off-by: Antonin Delpeuch --- docker-entrypoint.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 050865ae..c129857e 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -6,11 +6,6 @@ version_greater() { [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] } -# version_too_far_apart A B returns whether the major version of A is more than that of B + 1 -version_too_far_apart() { - [ ${majorImage%%.*} -gt $((${majorInstalled%%.*} + 1)) ] -} - # return true if specified directory is empty directory_empty() { [ -z "$(ls -A "$1/")" ] @@ -162,7 +157,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP if version_greater "$image_version" "$installed_version"; then echo "Initializing nextcloud $image_version ..." if [ "$installed_version" != "0.0.0.0" ]; then - if version_too_far_apart "$image_version" "$installed_version"; then + if [ ${majorImage%%.*} -gt $((${majorInstalled%%.*} + 1)) ]; then echo "Can't start Nextcloud because upgrading from $installed_version to $image_version is not supported." echo "It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16." exit 1