diff options
-rwxr-xr-x | bin/ncp-update-nc | 11 | ||||
-rw-r--r-- | bin/ncp/UPDATES/nc-update-nextcloud.sh | 3 | ||||
-rw-r--r-- | changelog.md | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc index fa86bbfc..2f41d4a3 100755 --- a/bin/ncp-update-nc +++ b/bin/ncp-update-nc @@ -6,7 +6,7 @@ # GPL licensed (see end of file) * Use at your own risk! # # Usage: -# bash ncp-update-nc <version> +# ncp-update-nc <version> # # More at https://ownyourbits.com # @@ -20,13 +20,15 @@ set -eE VER="$1" +BIN="${0##*/}" # pre-checks #################### +[[ "$VER" == "" ]] && { echo "Usage ${BIN} <version>"; exit 1; } [[ -f /.docker-image ]] && BASEDIR=/data || BASEDIR=/var/www cd "$BASEDIR" DATADIR="$( grep datadirectory nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 )" -[[ -d /var/www/nextcloud-old ]] && { echo "Nextcloud backup directory found. Interrupted installation?"; exit 1; } +[[ -d /var/www/nextcloud-old ]] && { echo "Nextcloud backup directory found. Interrupted or already running installation?"; exit 1; } [[ -d /var/www/nextcloud ]] || { echo "Nextcloud directory not found" ; exit 1; } [[ -d "$DATADIR" ]] || { echo "Nextcloud data directory not found" ; exit 1; } [[ "$(stat -fc%T "$BASEDIR")" == "btrfs" ]] && { echo "BTRFS not supported" ; exit 1; } @@ -56,7 +58,7 @@ elif [ "$MAJOR" -eq "$MAJ" ] && [ "$MINOR" -gt "$MIN" ]; then elif [ "$MAJOR" -eq "$MAJ" ] && [ "$MINOR" -eq "$MIN" ] && [ "$PATCH" -gt "$PAT" ]; then NEED_UPDATE=true fi - + echo "Current Nextcloud version $CURRENT" echo "Available Nextcloud version $VER" [[ "$NEED_UPDATE" == "true" ]] || { echo "Nothing to update"; exit 1; } @@ -179,9 +181,10 @@ find nextcloud/ -type f -exec chmod 640 {} \; echo "Upgrade..." ncc='sudo -u www-data php nextcloud/occ' $ncc upgrade # && false # test point -$ncc db:add-missing-indices +$ncc | grep -q db:add-missing-indices && $ncc db:add-missing-indices $ncc | grep -q db:add-missing-columns && $ncc db:add-missing-columns $ncc | grep -q db:add-missing-primary-keys && $ncc db:add-missing-primary-keys +$ncc | grep -q db:convert-filecache-bigint && $ncc db:convert-filecache-bigint # done #################### diff --git a/bin/ncp/UPDATES/nc-update-nextcloud.sh b/bin/ncp/UPDATES/nc-update-nextcloud.sh index 3f53fdaa..1dcfb05d 100644 --- a/bin/ncp/UPDATES/nc-update-nextcloud.sh +++ b/bin/ncp/UPDATES/nc-update-nextcloud.sh @@ -14,8 +14,7 @@ LATEST="$NCVER" configure() { [[ "$VERSION" == "0" ]] && VERSION="$LATEST" - bash /usr/local/bin/ncp-update-nc "$VERSION" && \ - sudo -u www-data php /var/www/nextcloud/occ -n db:convert-filecache-bigint + bash /usr/local/bin/ncp-update-nc "$VERSION" } install() { :; } diff --git a/changelog.md b/changelog.md index 5c6bb4cd..30c3f3ee 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,9 @@ -[v1.33.0](https://github.com/nextcloud/nextcloudpi/commit/c1b6239) (2020-12-10) upgrade to NC20.0.3 +[v1.33.1](https://github.com/nextcloud/nextcloudpi/commit/6891f49) (2020-12-12) nc-update-nc: improve error messages -[v1.32.1](https://github.com/nextcloud/nextcloudpi/commit/35c0d96) (2020-11-30) nc-update-nc: ncp apps might not exist +[v1.33.0](https://github.com/nextcloud/nextcloudpi/commit/ffd0b44) (2020-12-10) upgrade to NC20.0.3 + +[v1.32.1 ](https://github.com/nextcloud/nextcloudpi/commit/35c0d96) (2020-11-30) nc-update-nc: ncp apps might not exist [v1.32.0 ](https://github.com/nextcloud/nextcloudpi/commit/7afdc0f) (2020-11-24) upgrade to NC20.0.2 |