#!/bin/sh set -e echo 'Creating temporary working directory...' rm -rf /tmp/proton-ge-custom mkdir /tmp/proton-ge-custom cd /tmp/proton-ge-custom echo 'Creating Steam directory if it does not exist...' mkdir -p ~/.steam/root/compatibilitytools.d echo 'Getting ProtonGE metadata' METADATA=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4) test -n "$METADATA" # If result is not empty, continue echo 'Fetching tarball URL...' TARBALL_URL=$(echo "$METADATA" | grep .tar.gz) TARBALL_NAME=$(basename "$TARBALL_URL") VERSION_NAME=$(echo "$TARBALL_NAME" | sed 's/.tar.gz//') test -d ~/.steam/root/compatibilitytools.d/"$VERSION_NAME" && echo "Version $VERSION_NAME already present, aborting" && exit 0 echo "Downloading tarball: $TARBALL_NAME..." curl -# -L "$TARBALL_URL" -o "$TARBALL_NAME" --no-progress-meter echo 'Fetching checksum URL...' CHECKSUM_URL=$(echo "$METADATA" | grep .sha512sum) CHECKSUM_NAME=$(basename "$CHECKSUM_URL") echo "Downloading checksum: $CHECKSUM_NAME..." curl -# -L "$CHECKSUM_URL" -o "$CHECKSUM_NAME" --no-progress-meter echo "Verifying tarball $TARBALL_NAME with checksum $CHECKSUM_NAME..." sha512sum -c "$CHECKSUM_NAME" # If result is ok, continue echo "Extracting $TARBALL_NAME to Steam directory..." tar -xf "$TARBALL_NAME" -C ~/.steam/root/compatibilitytools.d/ echo 'All done :)'