cyberdeck-urt/server/entrypoint.sh
orca 0a99c4d0a8 cyberdeck-urt: endless Urban Terror bot arena (server image, companion, deploy)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:22:54 -05:00

35 lines
1.5 KiB
Bash
Executable file

#!/bin/sh
# Install Urban Terror 4.3.4 into /data on first start, then run the dedicated server.
#
# /data/UrbanTerror43 the game (binary + q3ut4/*.pk3), read-only to the server
# /data/home/q3ut4 the server's home path: cfgs copied from the image, games.log
#
# RCON_PASSWORD comes from the container's environment (deploy.py), never from the repo.
set -eu
ZIP_URL=http://cdn.urbanterror.info/urt/43/releases/zips/UrbanTerror434_full.zip
# the 2018-06-21 release; MD5 9bf7f0092161391697d24f6b004a6c6b matches the SlackBuilds listing
ZIP_SHA256=716669cc6c525663b791852e51ff9c94d96f382be39279dab6084dddacb5a4e7
GAME=/data/UrbanTerror43
HOME_Q3=/data/home/q3ut4
if [ ! -f "$GAME/.installed-434" ]; then
echo "installing Urban Terror 4.3.4 (first start, ~1.5 GB)"
rm -rf "$GAME" /data/urt.zip
curl -fL --retry 5 --retry-delay 10 -o /data/urt.zip "$ZIP_URL"
echo "$ZIP_SHA256 /data/urt.zip" | sha256sum -c -
# the dedicated server and the game data only: no clients, no Windows/macOS builds
unzip -q /data/urt.zip 'UrbanTerror43/Quake3-UrT-Ded.x86_64' 'UrbanTerror43/q3ut4/*.pk3' -d /data
rm /data/urt.zip
chmod +x "$GAME/Quake3-UrT-Ded.x86_64"
touch "$GAME/.installed-434"
echo "installed"
fi
mkdir -p "$HOME_Q3"
cp /config/cyberdeck-urt.cfg /config/mapcycle.txt "$HOME_Q3/"
exec "$GAME/Quake3-UrT-Ded.x86_64" \
+set fs_basepath "$GAME" +set fs_homepath /data/home +set fs_game q3ut4 \
+set dedicated 1 +set net_port "$URT_PORT" +set com_hunkmegs 256 \
+set rconpassword "${RCON_PASSWORD:-}" \
+exec cyberdeck-urt.cfg