mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
run-parts.sh: Compare minimum to currently installed nc version on docker startup
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
50640d9b9e
commit
a13a88bdb7
@ -140,6 +140,7 @@ LABEL maintainer="Ignacio Núñez Hernanz <nacho@ownyourbits.com>"
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
ENV DOCKERBUILD 1
|
||||
ENV MINIMUM_NC_VERSION=24
|
||||
|
||||
RUN mkdir -p /tmp/ncp-build
|
||||
COPY bin/ /tmp/ncp-build/bin/
|
||||
|
||||
@ -18,6 +18,15 @@ then
|
||||
cp -raT /data-ro /data
|
||||
fi
|
||||
|
||||
CURRENT_NC_VERSION="$(sudo -u www-data php -r "include(\"/var/www/nextcloud/config/config.php\"); echo(\$CONFIG[\"version\"]);")"
|
||||
CURRENT_NC_MAJ="${CURRENT_NC_VERSION%%.*}"
|
||||
[[ "$CURRENT_NC_MAJ" -ge "$MINIMUM_NC_VERSION" ]] || {
|
||||
echo "This image of NCP requires at least Nextcloud version ${MINIMUM_NC_VERSION} but you have ${CURRENT_NC_VERSION} installed. " \
|
||||
"Please upgrade your Nextcloud first (using the web UI), before upgrading to this NCP version."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# wrapper to simulate update-rc.d
|
||||
cat > /usr/local/sbin/update-rc.d <<'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user