From: Frank Brehm Date: Thu, 1 Feb 2024 09:58:55 +0000 (+0100) Subject: Fixing setting NEXTCLOUD_DIR_OLD in bin/update-nextcloud X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=39501f85ccd8ebfa41de8c6bed30dc59869f138b;p=pixelpark%2Fadmin-tools.git Fixing setting NEXTCLOUD_DIR_OLD in bin/update-nextcloud --- diff --git a/bin/update-nextcloud b/bin/update-nextcloud index 3b1b9fb..98216c5 100755 --- a/bin/update-nextcloud +++ b/bin/update-nextcloud @@ -181,8 +181,19 @@ get_old_version() { fi fi + NEXTCLOUD_DIR_OLD="${NEXTCLOUD_DIR}.old.${OLD_VERSION}" + if [[ -e "${NEXTCLOUD_DIR_OLD}" ]] ; then + local i=0 + NEXTCLOUD_DIR_OLD="${NEXTCLOUD_DIR}.old.${OLD_VERSION}.${i}" + while [[ -e "${NEXTCLOUD_DIR_OLD}" ]] ; do + i=$(( i + 1 )) + NEXTCLOUD_DIR_OLD="${NEXTCLOUD_DIR}.old.${OLD_VERSION}.${i}" + done + fi + echo info "Updating Nextcloud from version '${GREEN}${OLD_VERSION}${NORMAL}' to '${GREEN}${NEW_VERSION}${NORMAL}' ..." + debug "Old directory: '${CYAN}${NEXTCLOUD_DIR_OLD}${NORMAL}'." } diff --git a/lib/functions.rc b/lib/functions.rc index 7ac1efe..b432a5e 100644 --- a/lib/functions.rc +++ b/lib/functions.rc @@ -10,7 +10,7 @@ BLUE="" CYAN="" NORMAL="" -VERSION="0.4.3" +VERSION="0.5.0" STD_SHORT_OPTIONS="sdvqhV" STD_LONG_OPTIONS="simulate,debug,verbose,quiet,nocolor,help,version"