Browse Source
currently the gamemode.gi gets overwritten when updating the cs2 installation, but metamod needs to be referenced in the gamemod.gi. this fix adds the fix to the file if it is not there and if metamod is installed.pull/4500/head
3 changed files with 37 additions and 1 deletions
@ -0,0 +1,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 |
Loading…
Reference in new issue