From 808a87a3d23268e1692d0f5698ee7065f6123342 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Fri, 1 Jul 2022 10:48:31 +0200 Subject: [PATCH] mayan-edms - get latest version online --- seqs/mayan-edms.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/seqs/mayan-edms.sh b/seqs/mayan-edms.sh index 058cc6a..092c1bb 100755 --- a/seqs/mayan-edms.sh +++ b/seqs/mayan-edms.sh @@ -1,7 +1,6 @@ #!/bin/bash toolName="Mayan EDMS" -toolVersion="4.2.5" toolRoot="/opt/mayan-edms" toolMediaFolder="/opt/mayan-edms/media" @@ -36,6 +35,8 @@ seq_config() { ## Apt cmdline option to suppress user interaction quiet && APTOPT="-y" + toolVersion="$(getLatestVersion)" + ## Return of non zero value will abort the sequence return 0 } @@ -84,7 +85,7 @@ step_5() { # upgrade pip first step upgradepip - exe sudo -u mayan ${toolRoot}/bin/pip install --no-cache-dir mayan-edms==$toolVersion + exe sudo -u mayan ${toolRoot}/bin/pip install --no-cache-dir mayan-edms=="${toolVersion}" endReturn -o $? "pip install for $toolName failed" exe sudo -u mayan ${toolRoot}/bin/pip install --no-cache-dir psycopg2==2.8.4 redis==3.4.1 endReturn -o $? @@ -121,7 +122,7 @@ databases 2" step_10_info() { echoinfoArgs "[OPTIONS]" - echo "Upgrade $toolName to $toolVersion" + echo "Upgrade $toolName to ${toolVersion:-"latest Version"}" echoinfo " [OPTIONS]" echoinfo " super : update also supervisor configuration" echoinfo " (manual redis password update may be needed)" @@ -134,7 +135,7 @@ step_10() { exe sudo -u mayan ${toolRoot}/bin/pip uninstall -r "$uninstallRemovalsLoc" endReturn -o $? exe systemctl stop supervisor - exe sudo -u mayan ${toolRoot}/bin/pip install --no-cache-dir mayan-edms==$toolVersion + exe sudo -u mayan ${toolRoot}/bin/pip install --no-cache-dir mayan-edms=="${toolVersion}" endReturn -o $? toolScript performupgrade #toolScript preparestatic --noinput # only < 3.4 @@ -221,6 +222,10 @@ readDatabaseInfos() { info } +getLatestVersion() { + curl --silent -L https://docs.mayan-edms.com/releases/index.html | sed -n 's/.*Version \([0-9.]\+\).*/\1/p' | head -1 +} + # Needs readDatabaseInfos() to execute some commands toolScript() { if [ -n "${1:-}" ] ; then