From 47704130715e2993e8972035463f417ac120a2dd Mon Sep 17 00:00:00 2001 From: Pascal Paulis Date: Sun, 2 Nov 2025 19:14:15 +0100 Subject: [PATCH] also change tv_delay in gamemode_competitive.cfg Signed-off-by: Pascal Paulis --- sniper/etc/entry.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sniper/etc/entry.sh b/sniper/etc/entry.sh index d26f919..3a519e0 100644 --- a/sniper/etc/entry.sh +++ b/sniper/etc/entry.sh @@ -128,6 +128,16 @@ if [[ ! -z $CS2_BOT_QUOTA_MODE ]] ; then sed -i "s/bot_quota_mode.*/bot_quota_mode ${CS2_BOT_QUOTA_MODE}/" "${STEAMAPPDIR}"/game/csgo/cfg/* fi +# Rewrite tv_delay in gamemode_competitive.cfg (because it supersedes the value in server.cfg) +if [[ -n "${TV_DELAY}" ]]; then + COMPETITIVE_CFG="${STEAMAPPDIR}/game/csgo/cfg/gamemode_competitive.cfg" + if grep -q "^tv_delay" "$COMPETITIVE_CFG"; then + sed -ri "s/^tv_delay[[:space:]]+.*/tv_delay ${TV_DELAY}/" "$COMPETITIVE_CFG" + else + echo "tv_delay ${TV_DELAY}" >> "$COMPETITIVE_CFG" + fi +fi + # Switch to server directory cd "${STEAMAPPDIR}/game/"