From 13f1bec42b2192e0b07a4895c8f647c7e13c4b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sat, 8 Nov 2025 17:12:16 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20nextcloud:=20launch=20if=20up=20to?= =?UTF-8?q?=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/nextcloud-appimage-launch | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/bin/nextcloud-appimage-launch b/bin/nextcloud-appimage-launch index a0b5886..4e7c595 100755 --- a/bin/nextcloud-appimage-launch +++ b/bin/nextcloud-appimage-launch @@ -1,6 +1,6 @@ #!/bin/sh -INSTALL_DIR="/path/to/nextcloud-client" +INSTALL_DIR="/home/jmm/opt/apps/nextcloud-client" # name: nextcloud-appimage-launch # summary: Downloads and launches the latest Nextcloud (desktop) AppImage @@ -30,23 +30,20 @@ version_installed="$( \ | grep -Eo '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' \ )" -if [ "${version_available}" = "${version_installed}" ]; then - echo "nextcloud is up to date!" >&2 - exit 0 +if [ "${version_available}" != "${version_installed}" ]; then + echo "new nextcloud version available: ${version_available}" >&2 + notify-send \ + --app-name "Nextcloud" \ + --icon "${THISDIR}/.icon/nextcloud.svg" \ + "nextcloud-appimage-launch" \ + "new nextcloud version available: ${version_available}" + + curl --silent --show-error --fail --location \ + "https://github.com/nextcloud-releases/desktop/releases/download/v${version_available}/Nextcloud-${version_available}-x86_64.AppImage" \ + --output "${INSTALL_DIR}/Nextcloud-${version_available}-x86_64.AppImage" + + chmod +x "${INSTALL_DIR}/Nextcloud-${version_available}-x86_64.AppImage" + ln -sf "./Nextcloud-${version_available}-x86_64.AppImage" "${INSTALL_DIR}/current" fi -echo "new nextcloud version available: ${version_available}" >&2 -notify-send \ - --app-name "Nextcloud" \ - --icon "${THISDIR}/.icon/nextcloud.svg" \ - "nextcloud-appimage-launch" \ - "new nextcloud version available: ${version_available}" - -curl --silent --show-error --fail --location \ - "https://github.com/nextcloud-releases/desktop/releases/download/v${version_available}/Nextcloud-${version_available}-x86_64.AppImage" \ - --output "${INSTALL_DIR}/Nextcloud-${version_available}-x86_64.AppImage" - -chmod +x "${INSTALL_DIR}/Nextcloud-${version_available}-x86_64.AppImage" -ln -sf "./Nextcloud-${version_available}-x86_64.AppImage" "${INSTALL_DIR}/current" - exec "${INSTALL_DIR}/current" --background "${@}"