✨ nextcloud: launch if up to date
This commit is contained in:
parent
9fab880db1
commit
13f1bec42b
1 changed files with 15 additions and 18 deletions
|
|
@ -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
|
||||
fi
|
||||
|
||||
echo "new nextcloud version available: ${version_available}" >&2
|
||||
notify-send \
|
||||
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 \
|
||||
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"
|
||||
chmod +x "${INSTALL_DIR}/Nextcloud-${version_available}-x86_64.AppImage"
|
||||
ln -sf "./Nextcloud-${version_available}-x86_64.AppImage" "${INSTALL_DIR}/current"
|
||||
fi
|
||||
|
||||
exec "${INSTALL_DIR}/current" --background "${@}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue