From d46bea0340b2bf71bfecebbc7014d794c02d7355 Mon Sep 17 00:00:00 2001 From: Mihit Date: Wed, 19 Mar 2025 15:46:09 +1100 Subject: [PATCH] fixed order of operations --- update.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 5fe0f33..1e728b8 100755 --- a/update.sh +++ b/update.sh @@ -1,18 +1,25 @@ #!/bin/bash + if test -f latest.tar.bz2; then rm latest.tar.bz2 #Removes incomplete or old downloads fi + if [ -d "nextcloud.old" ]; then rm -r nextcloud.old #Removes old version of nextcloud fi + sudo -u www-data php nextcloud/occ maintenance:mode --on -mv nextcloud nextcloud.old + wget https://download.nextcloud.com/server/releases/latest.tar.bz2 +mv nextcloud nextcloud.old tar xf latest.tar.bz2 rm latest.tar.bz2 + mv nextcloud.old/config/config.php nextcloud/config mv nextcloud.old/data nextcloud + sudo chown www-data:www-data -R nextcloud + sudo -u www-data php nextcloud/occ upgrade sudo -u www-data php nextcloud/occ maintenance:mode --off sudo -u www-data php nextcloud/occ db:add-missing-indices