Add caching
This commit is contained in:
parent
39406477fe
commit
7266d65dfb
1 changed files with 6 additions and 5 deletions
11
osuboot.sh
11
osuboot.sh
|
@ -37,13 +37,14 @@ function downloadGame(){
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
echo "Downloading osu!lazer"
|
echo "Downloading osu!lazer"
|
||||||
wget "https://github.com/ppy/osu/releases/latest/download/osu.AppImage" -O /tmp/osuboot/osu.AppImage &> /tmp/osuboot/download.log
|
if [ ! -f "$HOME/.cache/osu.AppImage" ] || [[ $(find "$HOME/.cache/osu.AppImage" -mtime +1 -print) ]]; then
|
||||||
chmod +x /tmp/osuboot/osu.AppImage
|
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(){
|
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
|
if [ ! -f "$HOME/.cache/osu.AppImage" ]; then
|
||||||
echo "Launching osu!lazer: osu!lazer is missing and can't be launched."
|
echo "Launching osu!lazer: osu!lazer is missing and can't be launched."
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue