File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,22 @@ cd "$BASEDIR"
3232DATADIR=" $( grep datadirectory nextcloud/config/config.php | awk ' { print $3 }' | grep -oP " [^']*[^']" | head -1 ) "
3333ncc status & > /dev/null || { echo " Nextcloud is currently down" ; exit 1; }
3434[[ -d /var/www/nextcloud-old ]] && { echo " Nextcloud backup directory found. Interrupted or already running installation?" ; exit 1; }
35- [[ -d /var/www/nextcloud ]] || { echo " Nextcloud directory not found" ; exit 1; }
36- [[ -d " $DATADIR " ]] || { echo " Nextcloud data directory not found" ; exit 1; }
35+ [[ -d /var/www/nextcloud ]] || { echo " Nextcloud directory not found" ; exit 1; }
36+ [[ -d " $DATADIR " ]] || { echo " Nextcloud data directory not found" ; exit 1; }
3737
3838# check version
3939# ###################
4040
4141[[ ${EUID} -eq 0 ]] && SUDO=" sudo -u www-data"
4242CURRENT=" $( $SUDO php /var/www/nextcloud/occ status | grep " version:" | awk ' { print $3 }' ) "
4343
44+ MAJOR_CUR=$( cut -d. -f1 <<< " ${CURRENT}" )
45+ MAJOR_NEW=$( cut -d. -f1 <<< " ${VER}" )
46+ if [[ $(( MAJOR_NEW - MAJOR_CUR)) -gt 1 ]]; then
47+ echo " Upgrade cannot skip major versions. Please upgrade one major version at a time" >&2
48+ exit 1
49+ fi
50+
4451grep -qP " \d+\.\d+\.\d+" <<< " $CURRENT" || { echo " Malformed version $CURRENT " ; exit 1; }
4552grep -qP " \d+\.\d+\.\d+" <<< " $VER" || { echo " Malformed version $VER " ; exit 1; }
4653
You can’t perform that action at this time.
0 commit comments