-
-
Notifications
You must be signed in to change notification settings - Fork 860
Expand file tree
/
Copy pathfix_cs2.sh
More file actions
31 lines (23 loc) · 1000 Bytes
/
fix_cs2.sh
File metadata and controls
31 lines (23 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# LinuxGSM fix_csgo.sh module
# Author: https://github.com/pcace
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
# Description: Resolves issues with Counter-Strike: Global Offensive.
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: metamod installation (if installed) on cs2 updates
GAMEINFO="${serverfiles}/game/csgo/gameinfo.gi"
METAMOD_DIR="${serverfiles}/game/csgo/addons/metamod"
if [ -d "$METAMOD_DIR" ]; then
# Remove Windows line endings (\r) from gameinfo.gi
sed -i 's/\r$//' "$GAMEINFO"
# Check if the line "Game csgo/addons/metamod" exists in the file
if ! grep -q "Game csgo/addons/metamod" "$GAMEINFO"; then
# Open gameinfo.gi in the game/csgo directory
sed -i 's/#.*\n//g' "$GAMEINFO"
# Add Game csgo/addons/metamod to the SearchPaths section
sed -i '/Game_LowViolence/{
a Game csgo/addons/metamod
}' "$GAMEINFO"
fi
fi