From 6a2da9f55c9abd04943fa7022409ead4c97b0362 Mon Sep 17 00:00:00 2001 From: macmangr <106015597+macmangr@users.noreply.github.com> Date: Mon, 4 Jul 2022 12:49:29 +0200 Subject: [PATCH] Update libreoffice.sh Changed appNewVersion check, so that no download is started if the same version of the software is installed Changed download url --- fragments/labels/libreoffice.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fragments/labels/libreoffice.sh b/fragments/labels/libreoffice.sh index 2befca5..8f43339 100644 --- a/fragments/labels/libreoffice.sh +++ b/fragments/labels/libreoffice.sh @@ -2,11 +2,14 @@ libreoffice) name="LibreOffice" type="dmg" if [[ $(arch) == "arm64" ]]; then - downloadURL="https://download.documentfoundation.org/libreoffice/stable/$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)/mac/aarch64/LibreOffice_$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)_MacOS_aarch64.dmg" + releaseURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/aarch64/" + appNewVersion=$(curl -sf $releaseURL | grep -m 1 "_MacOS_aarch64.dmg" | sed "s|.*LibreOffice_\(.*\)_MacOS.*|\\1|") + downloadURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/aarch64/LibreOffice_"$appNewVersion"_MacOS_aarch64.dmg" elif [[ $(arch) == "i386" ]]; then - downloadURL="https://download.documentfoundation.org/libreoffice/stable/$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)/mac/x86_64/LibreOffice_$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)_MacOS_x86-64.dmg" + releaseURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/x86_64/" + appNewVersion=$(curl -sf $releaseURL | grep -m 1 "_MacOS_x86-64.dmg" | sed "s|.*LibreOffice_\(.*\)_MacOS.*|\\1|") + downloadURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/x86_64/LibreOffice_"$appNewVersion"_MacOS_x86-64.dmg" fi - appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)_.*/\1/g' ) expectedTeamID="7P5S3ZLCN7" blockingProcesses=( soffice ) ;;