]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Fixing setting NEXTCLOUD_DIR_OLD in bin/update-nextcloud
authorFrank Brehm <frank@brehm-online.com>
Thu, 1 Feb 2024 09:58:55 +0000 (10:58 +0100)
committerFrank Brehm <frank@brehm-online.com>
Thu, 1 Feb 2024 09:58:55 +0000 (10:58 +0100)
bin/update-nextcloud
lib/functions.rc

index 3b1b9fb193e5689100328984f8a52b0b5208fb88..98216c5a99284006b8a832511c9b1ddc25cb18c8 100755 (executable)
@@ -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}'."
 
 }
 
index 7ac1efe15729bbd7a70b86a10ba1c3ce16ddb284..b432a5e04d022bc798e7f309c624381f2e0114d1 100644 (file)
@@ -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"