Compare commits
1 commit
bce99f4684
...
da6a208a4f
| Author | SHA1 | Date | |
|---|---|---|---|
| da6a208a4f |
1 changed files with 18 additions and 25 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
INSTALL_DIR="/path/to/nextcloud-client"
|
INSTALL_DIR="/home/jmm/opt/apps/nextcloud-client"
|
||||||
|
|
||||||
# name: nextcloud-appimage-launch
|
# name: nextcloud-appimage-launch
|
||||||
# summary: Downloads and launches the latest Nextcloud (desktop) AppImage
|
# summary: Downloads and launches the latest Nextcloud (desktop) AppImage
|
||||||
|
|
@ -13,40 +13,33 @@ THISDIR="$(dirname "$(readlink -f "${0}")")"
|
||||||
needs_commands "curl" "notify-send"
|
needs_commands "curl" "notify-send"
|
||||||
|
|
||||||
version_available="$( \
|
version_available="$( \
|
||||||
curl --silent --verbose --retry-all-errors --retry-delay 3 --retry 5 \
|
curl -sSv 'https://github.com/nextcloud-releases/desktop/releases/latest' 2>&1 \
|
||||||
'https://github.com/nextcloud-releases/desktop/releases/latest' 2>&1 \
|
|
||||||
| grep '^< location: ' \
|
| grep '^< location: ' \
|
||||||
| grep -Eo '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' \
|
| grep -Eo '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' \
|
||||||
| head -n1 \
|
| head -n1 \
|
||||||
)"
|
)"
|
||||||
|
|
||||||
if [ -z "${version_available}" ]; then
|
|
||||||
echo "failed checking for nextcloud update" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
version_installed="$( \
|
version_installed="$( \
|
||||||
readlink "${INSTALL_DIR}/current" \
|
readlink "${INSTALL_DIR}/current" \
|
||||||
| grep -Eo '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' \
|
| grep -Eo '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' \
|
||||||
)"
|
)"
|
||||||
|
|
||||||
if [ "${version_available}" == "${version_installed}" ]; then
|
if [ -n "${version_available}" ] && [ "${version_available}" != "${version_installed}" ]; then
|
||||||
echo "nextcloud is up to date!" >&2
|
echo "new nextcloud version available: ${version_available}"
|
||||||
exit 0
|
notify-send \
|
||||||
|
--app-name "Nextcloud" \
|
||||||
|
--icon "${THISDIR}/.icon/nextcloud.svg" \
|
||||||
|
"nextcloud-appimage-launch" \
|
||||||
|
"new nextcloud version available: ${version_available}"
|
||||||
|
|
||||||
|
curl -sSfL \
|
||||||
|
"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"
|
||||||
|
else
|
||||||
|
echo "nextcloud is up to date!"
|
||||||
fi
|
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 "${@}"
|
exec "${INSTALL_DIR}/current" --background "${@}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue