nextcloud: launch if up to date

This commit is contained in:
Jörn-Michael Miehe 2025-11-08 17:12:16 +01:00
parent 9fab880db1
commit 13f1bec42b

View file

@ -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 "${@}"