Updates + Changes

Some code improvements. If the version ever changes, it will download the new binary if it doesn't already exist. Old ones will be kept however.

Some general changes to documentation.
This commit is contained in:
PassiveLemon
2023-06-21 13:01:22 -04:00
parent 3fbf246fb4
commit 3fc92bac27
4 changed files with 23 additions and 17 deletions

View File

@@ -7,14 +7,14 @@ if [ "$VERSION" != "" ]; then
release=${VERSION}
else
echo "|| Using latest release ||"
# Gets the latest pre-release version tag.
# Gets the latest pre-release version tag. Will be updated when official release comes out.
release=$(curl -s https://api.github.com/repos/tobychui/zoraxy/releases | jq -r 'map(select(.prerelease)) | .[0].tag_name')
fi
if [ ! -e /zoraxy/data/zoraxy_linux_amd64 ]; then
if [ ! -e "/zoraxy/data/zoraxy_linux_amd64-${release}" ]; then
echo "|| Downloading version ${release} ||"
curl -sL --output /zoraxy/data/zoraxy_linux_amd64 https://github.com/tobychui/zoraxy/releases/download/${release}/zoraxy_linux_amd64
chmod u+x /zoraxy/data/zoraxy_linux_amd64
curl -Lso /zoraxy/data/zoraxy_linux_amd64-${release} https://github.com/tobychui/zoraxy/releases/download/${release}/zoraxy_linux_amd64
chmod u+x /zoraxy/data/zoraxy_linux_amd64-${release}
fi
./zoraxy_linux_amd64 ${ARGS}
./zoraxy_linux_amd64-${release} ${ARGS}