Created
February 19, 2026 22:13
-
-
Save lildadou/f10c9bbf68a165a96d2e6c1b6bea2421 to your computer and use it in GitHub Desktop.
Update script Wilhelm-af/StarRupture-ModLoader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DIR_SOURCE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
| #script needs elevated privileges | |
| if [ ${UID} != 0 ];then | |
| err "script should be run as root or sudo" | |
| fi | |
| LANG=C | |
| APP_GITHUB_URL="https://github.com/Wilhelm-af/StarRupture-ModLoader" | |
| APP_SERVICE_NAME=netbox.service | |
| APP_HOME="/home/steam/.local/share/Steam/steamapps/common/StarRupture Dedicated Server/StarRupture/Binaries/Win64" | |
| APP_BIN_USER_GROUP="steam:steam" | |
| APP_GITHUB_LATEST_URL=$(wget -O /dev/null "${APP_GITHUB_URL}/releases/latest" 2>&1 | grep -w "Location:" | sed -nE "s,Location: (${APP_GITHUB_URL}"'/releases(/tag)?/v?[[:digit:]\.]+).+,\1,p' -) | |
| APP_GITHUB_LATEST_VER=$(echo "${APP_GITHUB_LATEST_URL}" | sed -nE "s,${APP_GITHUB_URL}"'/releases(/tag)?/v?([[:digit:]\.]+),\2,p' -) | |
| if [[ -f "${APP_HOME}/dwmapi.ver" && $(cat "${APP_HOME}/dwmapi.ver") == "$APP_GITHUB_LATEST_VER" ]]; then | |
| echo "Already up-to-date" | |
| exit 1 | |
| fi | |
| TMPFILE=$(mktemp) | |
| curl --fail --silent --location --output "${TMPFILE}" "${APP_GITHUB_URL}/releases/download/v${APP_GITHUB_LATEST_VER}/StarRupture-ModLoader-v${APP_GITHUB_LATEST_VER}.zip" | |
| rm "${APP_HOME}/dwmapi.dll" | |
| unzip "${TMPFILE}" -d "${APP_HOME}" > /dev/null | |
| chown -R "${APP_BIN_USER_GROUP}" "${APP_HOME}/dwmapi.dll" | |
| echo "StarRupture-ModLoader updated from "$(cat "${APP_HOME}/dwmapi.ver")" to ${APP_GITHUB_LATEST_VER}" | |
| echo "${APP_GITHUB_LATEST_VER}" > "${APP_HOME}/dwmapi.ver" | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment