Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2021-10-04 23:55:38 +0300
committernachoparker <nacho@ownyourbits.com>2021-10-05 00:13:02 +0300
commita0728d748789eae7ccb42433bbde194cec319790 (patch)
tree90d132c91f96993f4413ae204f202744857158b5 /bin/ncp-update-nc
parent20370640c7af3eb06c99cf56307a9553610ef1e7 (diff)
nc-notify-updates: notify of new supported NC versionsv1.40.0
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'bin/ncp-update-nc')
-rwxr-xr-xbin/ncp-update-nc19
1 files changed, 1 insertions, 18 deletions
diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc
index 50f6379b..9908edc7 100755
--- a/bin/ncp-update-nc
+++ b/bin/ncp-update-nc
@@ -45,26 +45,9 @@ CURRENT="$( $SUDO php /var/www/nextcloud/occ status | grep "version:" | awk '{ p
grep -qP "\d+\.\d+\.\d+" <<<"$CURRENT" || { echo "Malformed version $CURRENT"; exit 1; }
grep -qP "\d+\.\d+\.\d+" <<<"$VER" || { echo "Malformed version $VER" ; exit 1; }
-MAJOR=$( grep -oP "\d+\.\d+\.\d+" <<<"$VER" | cut -d. -f1 )
-MINOR=$( grep -oP "\d+\.\d+\.\d+" <<<"$VER" | cut -d. -f2 )
-PATCH=$( grep -oP "\d+\.\d+\.\d+" <<<"$VER" | cut -d. -f3 )
-
-MAJ=$( grep -oP "\d+\.\d+\.\d+" <<<"$CURRENT" | cut -d. -f1 )
-MIN=$( grep -oP "\d+\.\d+\.\d+" <<<"$CURRENT" | cut -d. -f2 )
-PAT=$( grep -oP "\d+\.\d+\.\d+" <<<"$CURRENT" | cut -d. -f3 )
-
-NEED_UPDATE=false
-if [ "$MAJOR" -gt "$MAJ" ]; then
- NEED_UPDATE=true
-elif [ "$MAJOR" -eq "$MAJ" ] && [ "$MINOR" -gt "$MIN" ]; then
- NEED_UPDATE=true
-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; } # we want `exit 1` so the autoupdate doesn't notify success in this case
+is_more_recent_than "${VER}" "${CURRENT}" || { echo "Nothing to update"; exit 1; } # we want `exit 1` so the autoupdate doesn't notify success in this case
# make sure that cron.php is not running and there are no pending jobs
# https://github.com/nextcloud/server/issues/10949