Files
Bubberstation/tools/ci/install_byond.sh
Roxy 21589b743a Add user agent string to BYOND download requests (#91101)
## About The Pull Request

Someone in the BYOND discord said that they were able to fix their CI
script by making sure the request had a user agent attached, and lummox
said that BYOND suffered a DDoS yesterday so the failures are probably
anti-bot measures.

## Why It's Good For The Game

Fix CI mayhaps

## Changelog

N/A
2025-05-11 13:59:38 -04:00

25 lines
713 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# BYOND_MAJOR and BYOND_MINOR can be explicitly set, such as in alt_byond_versions.txt
if [ -z "${BYOND_MAJOR+x}" ]; then
source dependencies.sh
fi
if [ -d "$HOME/BYOND/byond/bin" ] && grep -Fxq "${BYOND_MAJOR}.${BYOND_MINOR}" $HOME/BYOND/version.txt;
then
echo "Using cached directory."
else
echo "Setting up BYOND."
rm -rf "$HOME/BYOND"
mkdir -p "$HOME/BYOND"
cd "$HOME/BYOND"
curl -H "User-Agent: tgstation/1.0 CI Script" "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip
unzip byond.zip
rm byond.zip
cd byond
make here
echo "$BYOND_MAJOR.$BYOND_MINOR" > "$HOME/BYOND/version.txt"
cd ~/
fi