Skip to content

Commit 6919d8e

Browse files
committed
bug: try to fix csgo
1 parent e6d2f3b commit 6919d8e

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

scripts/setup-csgo.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,35 @@ cp -R "/opt/csgo-sourcemod/addons" "${INSTANCE_SERVER_DIR}/csgo"
3737
cp -R "/opt/csgo-metamod/addons" "${INSTANCE_SERVER_DIR}/csgo"
3838
cp -R "/opt/csgo-no-lobby-reservation/addons" "${INSTANCE_SERVER_DIR}/csgo"
3939

40+
if [ ! -d "/opt/custom-plugins" ]; then
41+
mkdir -p "/opt/custom-plugins"
42+
fi
43+
44+
if [ ! -d "/opt/custom-plugins/maps" ]; then
45+
mkdir -p "/opt/custom-plugins/maps"
46+
fi
47+
48+
if [ ! -e "/opt/custom-plugins/maps/mg_public.txt" ]; then
49+
cp "/opt/server-cfg/mg_public.txt" "/opt/custom-plugins/maps/mg_public.txt"
50+
fi
51+
52+
if [ ! -d "/opt/custom-plugins/cfg" ]; then
53+
mkdir -p "/opt/custom-plugins/cfg"
54+
fi
55+
56+
if [ ! -e "/opt/custom-plugins/cfg/server.cfg" ]; then
57+
cp "/opt/server-cfg/public.server.cfg" "/opt/custom-plugins/cfg/server.cfg"
58+
fi
59+
60+
create_symlinks "/opt/custom-plugins" "${INSTANCE_SERVER_DIR}/csgo"
61+
4062
echo "---Create Symbolic Links---"
4163
create_symlinks "$BASE_SERVER_DIR" "$INSTANCE_SERVER_DIR"
4264

43-
# Update steam.inf with correct app ID (4465480)
65+
# Update steam.inf with correct app ID (4465480), regardless of original appID
4466
STEAM_INF="${INSTANCE_SERVER_DIR}/csgo/steam.inf"
45-
sed -i 's/appID=740/appID=4465480/' "$STEAM_INF"
67+
if [ -f "$STEAM_INF" ]; then
68+
sed -i 's/appID=[0-9][0-9]*/appID=4465480/' "$STEAM_INF"
69+
else
70+
echo "WARNING: steam.inf not found at $STEAM_INF; appID not updated." >&2
71+
fi

0 commit comments

Comments
 (0)