diff --git a/osuboot.sh b/osuboot.sh index 8bd8e26..b1664b5 100755 --- a/osuboot.sh +++ b/osuboot.sh @@ -37,13 +37,14 @@ function downloadGame(){ return fi echo "Downloading osu!lazer" - wget "https://github.com/ppy/osu/releases/latest/download/osu.AppImage" -O /tmp/osuboot/osu.AppImage &> /tmp/osuboot/download.log - chmod +x /tmp/osuboot/osu.AppImage + if [ ! -f "$HOME/.cache/osu.AppImage" ] || [[ $(find "$HOME/.cache/osu.AppImage" -mtime +1 -print) ]]; then + wget "https://github.com/ppy/osu/releases/latest/download/osu.AppImage" -O "$HOME/.cache/osu.AppImage" &> /tmp/osuboot/download.log + else + echo "Downloading osu!lazer: Skipping, download is not yet a day old" + fi + chmod +x "$HOME/.cache/osu.AppImage" } function runGame(){ - if [ -f "/tmp/osuboot/osu.AppImage" ]; then - mv "/tmp/osuboot/osu.AppImage" "$HOME/.cache/osu.AppImage" - fi if [ ! -f "$HOME/.cache/osu.AppImage" ]; then echo "Launching osu!lazer: osu!lazer is missing and can't be launched." return