One-command setup (SteamCMD + pinned, checksum-verified ReHLDS / ReGameDLL / Metamod-R / AMXX / ReAPI / ReUnion / CSDM-ReAPI / YaPB / GunGame), .env settings, ./cs menu (map, DM/GunGame mode, bots, kill counter, restart, update), own plugins (extras, rtv, mode switch), all-time kill counter, watchdog + nightly backup, docs for admins and players. Co-Authored-By: Claude Opus 5.5 <[email protected]>
29 lines
1.1 KiB
Bash
Executable File
29 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# Container entry point: writes the .env values into the game configs, then starts the server.
|
|
# Runs at every container start, so edit .env (not these files) and run: docker compose up -d
|
|
set -e
|
|
C=/cs/hlds/cstrike
|
|
clean() { printf '%s' "$1" | tr -d '"\r'; } # no double quotes inside cfg strings
|
|
|
|
{
|
|
echo "// written from .env by tools/start.sh at every start: edit .env instead"
|
|
echo "hostname \"$(clean "$CS_HOSTNAME")\""
|
|
} > $C/env.cfg
|
|
|
|
# secrets.cfg holds the RCON + join password: readable only by the server user
|
|
umask 077
|
|
{
|
|
echo "// written by tools/start.sh at every start (RCON: secrets/rcon-password.txt, join: CS_PASSWORD in .env)"
|
|
echo "rcon_password \"$(tr -d '"\r\n' < /cs/secrets/rcon-password.txt)\""
|
|
echo "sv_password \"$(clean "$CS_PASSWORD")\""
|
|
} > $C/secrets.cfg
|
|
umask 022
|
|
|
|
sed -i -e "s/^yb_quota \".*\"/yb_quota \"${CS_BOTS:-0}\"/" \
|
|
-e "s/^yb_difficulty \".*\"/yb_difficulty \"${CS_BOT_DIFFICULTY:-2}\"/" \
|
|
$C/addons/yapb/conf/yapb.cfg
|
|
|
|
cd /cs/hlds
|
|
exec ./hlds_run -game cstrike -port "${CS_PORT:-27015}" +maxplayers "${CS_MAXPLAYERS:-16}" \
|
|
+map "${CS_MAP:-de_dust2}" -pingboost 2 -norestart +log on
|