mirror of
https://github.com/linuxserver/docker-nextcloud.git
synced 2026-02-19 23:03:50 +08:00
Add max upgrade check
Signed-off-by: Eric Nemchik <eric@nemchik.com>
This commit is contained in:
parent
cbda0f1b45
commit
038280e26e
@ -50,6 +50,10 @@ installed_version=$(php -r "require '/config/www/nextcloud/config/config.php'; e
|
||||
if [ "${installed_version}" = "" ]; then
|
||||
installed_version="0.0.0.0"
|
||||
fi
|
||||
image_major="${image_version%%.*}"
|
||||
installed_major="${installed_version%%.*}"
|
||||
max_upgrade=
|
||||
((max_upgrade=installed_major+1))
|
||||
|
||||
# compare versions
|
||||
vergte() { printf '%s\n%s' "${2}" "${1}" | sort -C -V; }
|
||||
@ -57,6 +61,11 @@ vergt() { ! vergte "${2}" "${1}"; }
|
||||
verlte() { printf '%s\n%s' "${1}" "${2}" | sort -C -V; }
|
||||
verlt() { ! verlte "${2}" "${1}"; }
|
||||
|
||||
if [ "${installed_version}" != "0.0.0.0" ] && vergt "${image_version}" "${max_upgrade}"; then
|
||||
echo "Can't start Nextcloud because the version of the data (${installed_version}) is more than one major version behind the docker image version (${image_version}) and upgrading more than one major version is not supported. Please run an image tagged for the major version ${max_upgrade} first."
|
||||
sleep infinity
|
||||
fi
|
||||
|
||||
if vergt "${installed_version}" "${image_version}"; then
|
||||
echo "Can't start Nextcloud because the version of the data (${installed_version}) is higher than the docker image version (${image_version}) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
||||
sleep infinity
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user