greetings fellow unix gamer
it is my greatest pleasure to inform you, that the Ascension Launcher Updater (or ALU for short) now inoffically official hit public pre alpha. what does it do? it searches for the latest version of the ascension launcher and downloads it, without the need to open a browser, without the need to log into your account and click to many buttons to even bother. how many packages do you need to add i hear you ask? none. assuming you got 'curl' and 'wget'. which you do. most likely.
the ALU is a simple yet extremely unoptimized bash script, that could be executed on your machine today! gone are the anoying days of the launcher telling you to manualy update. the ALU even sets execution permission and asks you if it should launch the launcher. amazing. but how does it work? simple. put it in the directory where your ascension launcher is located and make sure you did not rename the official launcher. now just run the script in your favorite terminal that knows how to handle bash and you are all set up.
are you afraid of terminals? don't be, they can smell your fear. the ALU is operated by simple yes or no questions, even my cat could operate it without error. and i don't even have a cat.
i did some intensive edge case testing, which i think are now all covered. this in turn lead to some serious bloat in redundant code, but you know what? the ALU is already perfect as is, it does not need a switch case. and here it is, get hyped, buckle your pants and most importantly hydrate well, here it is, 299 lines of madness, the one and only, ALUv001.sh:
#!/bin/bash
echo "ascension launcher updater v0.0.1"
sleep 1
VERSION_MIN=0
VERSION_MAX=999
if [ ! -f current_version.txt ]; then
echo "... first launch"
sleep .5
read -r -p "set up updater? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
sleep 1
echo "creating 'current_version.txt' file..."
touch current_version.txt
sleep .5
echo "creating 'old_launchers' directory..."
mkdir old_launchers
sleep .5
echo "checking for current launcher version..."
sleep .5
if [ ! -f ascension-launcher-*.AppImage ]; then
echo "[ERR] no launcher found"
sleep 1
echo "setting current version to ${VERSION_MIN}..."
sleep .5
echo "${VERSION_MIN}" > current_version.txt
sleep .5
else
VERSION=$( ls ascension-launcher-*.AppImage )
VERSION=${VERSION%.*}
VERSION=${VERSION##*-}
echo "ascension launcher version ${VERSION} found"
sleep 1
echo "printing to file..."
echo "${VERSION}" > current_version.txt
sleep .5
fi
echo "setup complete."
sleep 1
else
echo "abort..."
sleep .5
fi
else
echo "welcome back!"
sleep 1
fi
VERSION=$( < current_version.txt )
if (($VERSION > $VERSION_MAX)); then
echo "[ERR] launcher version > ${VERSION_MAX}"
sleep .5
read -r -p "check again for current version? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
if [ ! -f ascension-launcher-*.AppImage ]; then
sleep .5
echo "[ERR] no launcher found"
sleep 1
echo "setting current version to ${VERSION_MIN}..."
sleep .5
echo "${VERSION_MIN}" > current_version.txt
VERSION=$( < current_version.txt )
sleep .5
else
VERSION=$( ls ascension-launcher-*.AppImage )
VERSION=${VERSION%.*}
VERSION=${VERSION##*-}
sleep .5
echo "ascension launcher version ${VERSION} found"
sleep 1
echo "printing to file..."
echo "${VERSION}" > current_version.txt
VERSION=$( < current_version.txt )
sleep .5
fi
else
sleep .5
echo "setting current version to ${VERSION_MIN}..."
sleep .5
echo "${VERSION_MIN}" > current_version.txt
VERSION=$( < current_version.txt )
sleep .5
fi
else
echo "current version appears to be ${VERSION}..."
sleep .5
read -r -p "correct? [Y/n] " response
if [[ "$response" =~ ^([nN])$ ]]; then
sleep .5
echo "assuming irregular value due to unforseen script abortion"
VERSION=$((VERSION-1))
echo "${VERSION}" > current_version.txt
sleep .5
echo "corrected value to ${VERSION}"
sleep 1
fi
fi
read -r -p "check for new version? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
sleep .5
echo "checking..."
STATUS_CODE=$( curl -s -o /dev/null -I -w "%{http_code}" https://download.ascension-patch.gg/update/ascension-launcher-${VERSION}.AppImage )
STATUS_OK=200
if (( $STATUS_CODE == $STATUS_OK )); then
sleep .5
while (( $STATUS_CODE == $STATUS_OK )); do
echo "version ${VERSION} accessible"
sleep 2
VERSION=$((VERSION+1))
echo "${VERSION}" > current_version.txt
STATUS_CODE=$( curl -s -o /dev/null -I -w "%{http_code}" https://download.ascension-patch.gg/update/ascension-launcher-${VERSION}.AppImage )
echo "..."
if (($VERSION > $VERSION_MAX)); then
sleep .5
echo "[ERR] launcher version > ${VERSION_MAX}"
sleep 1
echo "setting current version to ${VERSION_MIN}..."
sleep .5
echo "${VERSION_MIN}" > current_version.txt
sleep .5
read -p "press 'enter' to quit..."
exit
fi
done
VERSION=$((VERSION-1))
echo "${VERSION}" > current_version.txt
echo "latest version found"
if [ ! -f ascension-launcher-*.AppImage ]; then
sleep 1
read -r -p "download? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
sleep .5
wget https://download.ascension-patch.gg/update/ascension-launcher-${VERSION}.AppImage
sleep .5
echo "complete."
sleep .5
echo "setting permission for owner to rx"
chmod a=,u=rx ascension-launcher-*.AppImage
sleep .5
read -r -p "launch the launcher? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
./ascension-launcher-*.AppImage
fi
else
sleep .5
read -p "press 'enter' to quit..."
exit
fi
else
VERSION_OLD=$( ls ascension-launcher-*.AppImage )
VERSION_OLD=${VERSION_OLD%.*}
VERSION_OLD=${VERSION_OLD##*-}
if (( $VERSION != $VERSION_OLD )); then
sleep 1
echo "moving old launcher..."
mv ascension-launcher-*.AppImage old_launchers
sleep .5
echo "moved"
sleep .5
read -r -p "download new launcher? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
sleep .5
wget https://download.ascension-patch.gg/update/ascension-launcher-${VERSION}.AppImage
sleep .5
echo "complete."
sleep .5
echo "setting permission for owner to rx"
chmod a=,u=rx ascension-launcher-*.AppImage
sleep .5
read -r -p "launch the launcher? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
./ascension-launcher-*.AppImage
fi
fi
else
echo "you appear to be using the latest version"
sleep .5
echo "setting permission for owner to rx"
chmod a=,u=rx ascension-launcher-*.AppImage
sleep .5
read -r -p "launch the launcher? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
./ascension-launcher-*.AppImage
fi
fi
fi
else
sleep .5
echo="searching for latest version..."
sleep .5
echo="this may take a while, brush your teeth"
while (( $STATUS_CODE != $STATUS_OK )); do
sleep 2
VERSION=$((VERSION+1))
echo "${VERSION}" > current_version.txt
echo "${VERSION}"
STATUS_CODE=$( curl -s -o /dev/null -I -w "%{http_code}" https://download.ascension-patch.gg/update/ascension-launcher-${VERSION}.AppImage )
echo "..."
if (($VERSION > $VERSION_MAX)); then
sleep .5
echo "[ERR] launcher version > ${VERSION_MAX}"
sleep 1
echo "setting current version to ${VERSION_MIN}..."
sleep .5
echo "${VERSION_MIN}" > current_version.txt
sleep .5
read -p "press 'enter' to quit..."
exit
fi
done
while (( $STATUS_CODE == $STATUS_OK )); do
echo "version ${VERSION} accessible"
sleep 2
VERSION=$((VERSION+1))
echo "${VERSION}" > current_version.txt
STATUS_CODE=$( curl -s -o /dev/null -I -w "%{http_code}" https://download.ascension-patch.gg/update/ascension-launcher-${VERSION}.AppImage )
echo "..."
if (($VERSION > $VERSION_MAX)); then
sleep .5
echo "[ERR] launcher version > ${VERSION_MAX}"
sleep 1
echo "setting current version to ${VERSION_MIN}..."
sleep .5
echo "${VERSION_MIN}" > current_version.txt
sleep .5
read -p "press 'enter' to quit..."
exit
fi
done
VERSION=$((VERSION-1))
echo "${VERSION}" > current_version.txt
sleep .5
echo "latest version found"
sleep 1
echo "moving old launcher..."
mv ascension-launcher-*.AppImage old_launchers
sleep .5
echo "moved"
sleep .5
read -r -p "download new launcher? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
sleep .5
wget https://download.ascension-patch.gg/update/ascension-launcher-${VERSION}.AppImage
sleep .5
echo "complete."
sleep .5
echo "setting permission for owner to rx"
chmod a=,u=rx ascension-launcher-*.AppImage
sleep .5
read -r -p "launch the launcher? [y/N] " response
if [[ "$response" =~ ^([yY])$ ]]; then
./ascension-launcher-*.AppImage
fi
fi
fi
else
echo "abort..."
sleep .5
fi
read -p "press 'enter' to quit..."
exit
# stay hydrated
#
# ALU brought to you by x3cutiex3