One-command setup (SteamCMD + minqlx build), .env settings with a listed/unlisted switch, three factories (lgvamp, lgvamp_nolag, lgvamp100), warmup-text and welcome minqlx plugins, watchdog/backup/daily-restart, docs for admins and players. Co-Authored-By: Claude Opus 5.5 <[email protected]>
36 lines
1.3 KiB
Bash
Executable File
36 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# Runs inside the container before the server starts: turns the .env settings (passed in as
|
|
# environment variables) into home/baseq3/local.cfg, secrets.cfg and mappool_lg.txt.
|
|
# server.cfg execs secrets.cfg and local.cfg; local.cfg ends with the map command.
|
|
set -e
|
|
B=/ql/home/baseq3
|
|
clean() { printf '%s' "$1" | tr -d '"\r'; }
|
|
|
|
PW=$(tr -d '\r\n' < /ql/secrets/rcon-password.txt)
|
|
[ -n "$PW" ] || { echo "mkcfg: secrets/rcon-password.txt is empty (run setup.sh)" >&2; exit 1; }
|
|
|
|
case "$QL_LISTED" in
|
|
yes|1|true) MASTER=1 ;;
|
|
*) MASTER=0 ;;
|
|
esac
|
|
FACTORY=$(clean "${QL_FACTORY:-lgvamp}")
|
|
MAP=$(clean "${QL_MAP:-thunderstruck}")
|
|
case "$FACTORY" in lgvamp_nolag) TAGS="lg,vampiric,ffa" ;; *) TAGS="lg,vampiric,ffa,antilag" ;; esac
|
|
|
|
umask 077
|
|
printf 'set zmq_rcon_password "%s"\n' "$(clean "$PW")" > $B/secrets.cfg
|
|
umask 022
|
|
cat > $B/local.cfg <<EOF
|
|
// Generated from .env by tools/mkcfg.sh on every start. Edit .env, not this file.
|
|
set sv_hostname "$(clean "${QL_HOSTNAME:-LG Vampiric FFA}")"
|
|
set sv_tags "$TAGS"
|
|
set sv_master "$MASTER"
|
|
set g_password "$(clean "$QL_PASSWORD")"
|
|
set sv_maxClients "$(clean "${QL_MAXCLIENTS:-16}")"
|
|
set zmq_rcon_port "$(clean "${QL_RCON_PORT:-28960}")"
|
|
set qlx_welcome "$(clean "$QL_WELCOME")"
|
|
map $MAP $FACTORY
|
|
EOF
|
|
echo "$MAP|$FACTORY" > $B/mappool_lg.txt
|
|
echo "mkcfg: $MAP $FACTORY, listed=$MASTER, port ${QL_PORT}"
|