From d0cdd8d271c3d86dba88ac91768c6be83f9faa67 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Tue, 26 May 2020 17:26:37 +0200 Subject: [PATCH] Bump version to 3.4.9 Adding option to not update supervisor configuration --- seqs/mayan-edms.sh | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/seqs/mayan-edms.sh b/seqs/mayan-edms.sh index e2f0007..6962b36 100755 --- a/seqs/mayan-edms.sh +++ b/seqs/mayan-edms.sh @@ -1,7 +1,7 @@ #!/bin/bash toolName="Mayan EDMS" -toolVersion="3.4.5" +toolVersion="3.4.9" toolRoot="/opt/mayan-edms" toolMediaFolder="/opt/mayan-edms/media" @@ -90,9 +90,14 @@ maxmemory-policy allkeys-lru save \"\" databases 2" -step_10_info() { echo "Upgrade $toolName to $toolVersion"; } +step_10_info() { + echo "Upgrade $toolName to $toolVersion [OPTIONS]" + echoinfo " [OPTIONS]" + echoinfo " nosuper : skip supervisor configuration generation" +} step_10_alias() { ALIAS="upgrade"; } step_10() { + shift # don't need the step number exe curl -o "$uninstallRemovalsLoc" https://gitlab.com/mayan-edms/mayan-edms/raw/master/removals.txt exe sudo -u mayan ${toolRoot}/bin/pip uninstall -r "$uninstallRemovalsLoc" endReturn -o $? @@ -101,8 +106,15 @@ step_10() { endReturn -o $? toolScript performupgrade #toolScript preparestatic --noinput # only < 3.4 - # Generating new supervisor file - step supervisorconf + case $1 in + "nosuper") + echo " [I] Skipping supervisor configuration update" + ;; + *) + # Generating new supervisor file + step supervisorconf + ;; + esac exe systemctl start supervisor } uninstallRemovalsLoc="/tmp/removals.txt" @@ -135,13 +147,14 @@ step_15() step_20_info() { echo "Backup postgres database to media folder"; } step_20_alias() { ALIAS="backupdb"; } step_20() { - local LASTYEAR=$(($(date +%Y)-1)) + local DELYEAR=$(($(date +%Y)-2)) if [ ! -s ~/.pgpass ] ; then echo " [I] For unattended backup please define ~/.pgpass containing credentials for user mayan" + echo " e.g. localhost:5432:mayan:mayan:pass4mayan" + echo "Backup custom pg format with standard user / database: mayan / mayan" fi - echo "Backup custom pg format with standard user / database: mayan / mayan" exep "pg_dump -h 127.0.0.1 -U mayan -Fc mayan | bzip2 -c > ${toolDbBackupFolder}/`date +%Y-%m-%d\"_\"%H-%M-%S`.backup.bz2" - exe rm -f ${toolDbBackupFolder}/${LASTYEAR}* + exe rm -f ${toolDbBackupFolder}/${DELYEAR}* } toolDbBackupFolder=${toolMediaFolder}/backupdb