update-nc.sh: Improve output if no new NC version is available

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
Tobias Knöppler 2024-08-19 02:09:46 +02:00
parent 4d9102a967
commit 51a2d0f662
No known key found for this signature in database
GPG Key ID: 3510056072886A8F

View File

@ -23,6 +23,10 @@ ncc status &>/dev/null || { [[ "$DBG" == x ]] && ncc status; echo "Next
[[ ${EUID} -eq 0 ]] && SUDO="sudo -u www-data"
CURRENT="$(nc_version)"
TARGET_VERSION="$(determine_nc_upgrade_version "${CURRENT?}" "${VER?}")"
[[ "$TARGET_VERSION" == "$CURRENT" ]] && {
echo "Nextcloud version ${CURRENT} is already installed. Nothing to do."
exit 0
}
[[ -n "$TARGET_VERSION" ]] || {
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
exit 1