43 lines
1.7 KiB
Bash
43 lines
1.7 KiB
Bash
#!/bin/bash
|
|
# ==========================================================================
|
|
# IW4X startup wrapper (place at /home/container/start-iw4x.sh, chmod +x)
|
|
# Called by the egg's Startup Command.
|
|
# ==========================================================================
|
|
cd /home/container || exit 1
|
|
|
|
export WINEARCH=win32
|
|
export WINEPREFIX=/home/container/.wine
|
|
export WINEDEBUG="${WINEDEBUG:--all}"
|
|
|
|
# --- Seed the known-good 32-bit prefix baked into the image (first boot) ---
|
|
# The image ships a fully-initialised win32 prefix at /opt/wine-prefix with
|
|
# vcrun2019 + d3dcompiler_47 already installed. If the volume doesn't have a
|
|
# valid win32 prefix yet, copy it in. This avoids the stock entrypoint
|
|
# rebuilding a broken win64 prefix.
|
|
if [ ! -f "${WINEPREFIX}/system.reg" ] || ! grep -q '#arch=win32' "${WINEPREFIX}/system.reg" 2>/dev/null; then
|
|
echo "[iw4x] Seeding fresh win32 wine prefix from image..."
|
|
rm -rf "${WINEPREFIX}"
|
|
cp -a /opt/wine-prefix "${WINEPREFIX}"
|
|
echo "[iw4x] Prefix ready: $(head -1 ${WINEPREFIX}/system.reg)"
|
|
else
|
|
echo "[iw4x] Existing win32 prefix detected, reusing it."
|
|
fi
|
|
|
|
# --- Update IW4X client files via the official launcher (no Steam login) ---
|
|
if [ -f ./iw4x-launcher ]; then
|
|
echo "[iw4x] Running launcher update..."
|
|
./iw4x-launcher --update
|
|
fi
|
|
|
|
# --- Launch the dedicated server ------------------------------------------
|
|
# Mirrors the official DedicatedServer.sh invocation.
|
|
echo "[iw4x] Launching server..."
|
|
exec wine iw4x.exe -dedicated -stdout \
|
|
+set fs_game "${MOD_DIR}" \
|
|
+set sv_lanonly "${LAN_MODE:-0}" \
|
|
+set net_port "${SERVER_PORT}" \
|
|
+exec "${SERVER_CFG:-server.cfg}" \
|
|
+set logfile "${LOG_FILE:-1}" \
|
|
+set party_enable "0" \
|
|
+map_rotate
|