From 4a7a411ecb8dbaa0d24d958ac406b1ba8ef74f64 Mon Sep 17 00:00:00 2001 From: Marvin Lehmann Date: Sat, 21 Oct 2017 18:27:00 +0200 Subject: [PATCH] Improved CS:GO fixes --- lgsm/functions/fix_csgo.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index 358da07b1..5eca2f6eb 100644 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -17,19 +17,19 @@ if [ ! -f "${serverfiles}/steam_appid.txt" ]; then fi # Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'". -if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then +if [ -f "${systemdir}/botprofile.db" ] && grep "^\s*Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then fixname="botprofile.db" fn_fix_msg_start - sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 + sed -i 's/\s*Rank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 fn_fix_msg_end fi -# Fixes: Unknown command "cl_bobamt_vert". -if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then +# Fixes: Unknown command "cl_bobamt_vert" and exec: couldn't exec joystick.cfg. +if [ -f "${servercfgdir}/valve.rc" ] && grep -E '^\s*exec\s*(default|joystick)\.cfg' "${servercfgdir}/valve.rc" > /dev/null 2>&1; then fixname="valve.rc" fn_fix_msg_start - sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 - sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 + sed -i 's/^\s*exec\s*default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 + sed -i 's/^\s*exec\s*joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 fn_fix_msg_end fi @@ -42,4 +42,4 @@ if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subsc rm -f "${systemdir}/subscribed_file_ids.txt" rm -f "${systemdir}/ugc_collection_cache.txt" fn_fix_msg_end -fi \ No newline at end of file +fi