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