Created
April 23, 2024 17:37
-
-
Save ckuethe/78edca9b956d6b649eb3a00d12d6483a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APPIMAGE_DIR="${HOME}/AppImage" | |
mkdir -p ${APPIMAGE_DIR} | |
BASE="https://download.nextcloud.com/desktop/releases/Linux" | |
LATEST=$(curl --silent "${BASE}/?C=M;O=D" | \ | |
grep 'Next[Cc]loud.*[.]AppImage[.]asc' | \ | |
head -1 | \ | |
sed -e 's/.*asc">//' -e 's/[.]asc<.*//' | |
) | |
DESTFILE="${APPIMAGE_DIR}/${LATEST}" | |
test -f "${DESTFILE}" && exit | |
echo updating to $LATEST | |
echo curl -o "${TMP}" "${BASE}/${LATEST}" | |
TMP=$(mktemp -p "${APPIMAGE_DIR}") | |
curl -o "${TMP}" "${BASE}/${LATEST}" | |
if [ $? -eq 0 ] ; then | |
mv "${TMP}" "${DESTFILE}" | |
chmod +x "${DESTFILE}" | |
else | |
rm "${TMP}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment