Skip to content

Instantly share code, notes, and snippets.

@ckuethe
Created April 23, 2024 17:37
Show Gist options
  • Save ckuethe/78edca9b956d6b649eb3a00d12d6483a to your computer and use it in GitHub Desktop.
Save ckuethe/78edca9b956d6b649eb3a00d12d6483a to your computer and use it in GitHub Desktop.
#!/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