Allow download URL customization

This commit is contained in:
JeremyStar™ 2024-08-09 23:41:58 +02:00
parent 9c14e94090
commit 13fdc34017
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -36,6 +36,8 @@ elif [ "${OSUBOOT_MAX_CACHE_TIME}" -lt "1" ]; then
echo "Initialization error: \$OSUBOOT_MAX_CACHE_TIME must be at least 1" echo "Initialization error: \$OSUBOOT_MAX_CACHE_TIME must be at least 1"
exit 1 exit 1
fi fi
# DOWNLOAD_URL
[[ -z "${OSUBOOT_DOWNLOAD_URL}" ]] && OSUBOOT_DOWNLOAD_URL="https://github.com/ppy/osu/releases/latest/download/osu.AppImage"
# Display startup messages # Display startup messages
echo -en "${COLOR_SPECIAL}" echo -en "${COLOR_SPECIAL}"
@ -100,7 +102,7 @@ echo -en "${COLOR_DEFAULT}:: Downloading osu!lazer"
if [ -z "${OSUBOOT_DRYRUN}" ]; then if [ -z "${OSUBOOT_DRYRUN}" ]; then
if [ ! -f "$HOME/.cache/osu.AppImage" ] || [ -n "$(find "$HOME/.cache/osu.AppImage" -ctime "+${OSUBOOT_MAX_INITIALIZATION_TIME}" 2>/dev/null)" ]; then if [ ! -f "$HOME/.cache/osu.AppImage" ] || [ -n "$(find "$HOME/.cache/osu.AppImage" -ctime "+${OSUBOOT_MAX_INITIALIZATION_TIME}" 2>/dev/null)" ]; then
echo -e "${RESET}" echo -e "${RESET}"
wget --quiet --show-progress -O "$HOME/.cache/osu.AppImage.tmp" "https://github.com/ppy/osu/releases/latest/download/osu.AppImage" wget --quiet --show-progress -O "$HOME/.cache/osu.AppImage.tmp" "${OSUBOOT_DOWNLOAD_URL}"
mv "${HOME}/.cache/osu.AppImage.tmp" "${HOME}/.cache/osu.AppImage" mv "${HOME}/.cache/osu.AppImage.tmp" "${HOME}/.cache/osu.AppImage"
chmod +x "${HOME}/.cache/osu.AppImage" chmod +x "${HOME}/.cache/osu.AppImage"
else else