Use official sha256 endpoint for update check (#477)

This commit is contained in:
Vinzenz Sinapius 2023-11-11 16:34:07 +01:00 committed by GitHub
parent f255b89a5e
commit abf3166142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,8 +4,8 @@ SEMVER_REGEX="^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
stable_online_version=$(curl 'https://factorio.com/api/latest-releases' | jq '.stable.headless' -r)
experimental_online_version=$(curl 'https://factorio.com/api/latest-releases' | jq '.experimental.headless' -r)
stable_sha256=$(curl "https://www.factorio.com/get-download/${stable_online_version}/headless/linux64" -L | sha256sum | awk '{print $1}')
experimental_sha256=$(curl "https://www.factorio.com/get-download/${experimental_online_version}/headless/linux64" -L | sha256sum | awk '{print $1}')
stable_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep "factorio_headless_x64_${stable_online_version}.tar.xz" | awk '{print $1}')
experimental_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep "factorio_headless_x64_${experimental_online_version}.tar.xz" | awk '{print $1}')
stable_current_version=$(jq 'with_entries(select(contains({value:{tags:["stable"]}}))) | keys | .[0]' buildinfo.json -r)
latest_current_version=$(jq 'with_entries(select(contains({value:{tags:["latest"]}}))) | keys | .[0]' buildinfo.json -r)
echo "stable_online_version=${stable_online_version} experimental_online_version=${experimental_online_version}"