ncp-update-nc: 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 bf98d0eade
commit bb98f597e9
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
2 changed files with 5 additions and 0 deletions

View File

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

View File

@ -534,6 +534,7 @@ function determine_nc_upgrade_version() {
if [[ "${supported_maj}" -le "${current_maj}" ]] if [[ "${supported_maj}" -le "${current_maj}" ]]
then then
echo "$current"
# No update available # No update available
return 0 return 0
fi fi