fn_csgofix 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. # LGSM fn_csgofix function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 011214
  6. fn_csgoappfix(){
  7. if [ ! -f "${filesdir}/steam_appid.txt" ]; then
  8. fn_printdots "Applying 730 steam_appid.txt Fix."
  9. sleep 1
  10. fn_printinfo "Applying 730 steam_appid.txt Fix."
  11. sleep 1
  12. echo -en "\n"
  13. echo -n "730" >> "${filesdir}/steam_appid.txt"
  14. fi
  15. }
  16. fn_csgofixes(){
  17. # Fixes the following error
  18. # Error parsing BotProfile.db - unknown attribute 'Rank"
  19. if ! grep -q "//Rank" "${systemdir}/botprofile.db" ; then
  20. echo "botprofile.db fix removes the following error from appearing on the console:"
  21. echo " Error parsing BotProfile.db - unknown attribute 'Rank"
  22. sleep 1
  23. fn_printdots "Applying botprofile.db fix."
  24. sleep 1
  25. fn_printinfo "Applying botprofile.db fix."
  26. sleep 1
  27. sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db"
  28. echo -en "\n"
  29. echo ""
  30. fi
  31. # Fixes errors simular to the following
  32. # Unknown command "cl_bobamt_vert"
  33. if ! grep -q "//exec default" "${servercfgdir}/valve.rc" || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc"; then
  34. echo "valve.rc fix removes the following error from appearing on the console:"
  35. echo " Unknown command \"cl_bobamt_vert\""
  36. sleep 1
  37. fn_printdots "Applying valve.rc fix."
  38. sleep 1
  39. fn_printinfo "Applying valve.rc fix."
  40. sleep 1
  41. sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc"
  42. sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc"
  43. echo -en "\n"
  44. echo ""
  45. fi
  46. # Fixes errors simular to the following
  47. # http://forums.steampowered.com/forums/showthread.php?t=3170366
  48. if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subscribed_file_ids.txt" ]||[ -f "${systemdir}/ugc_collection_cache.txt" ]; then
  49. echo "workshopmapfix fixes the following error:"
  50. echo " http://forums.steampowered.com/forums/showthread.php?t=3170366"
  51. sleep 1
  52. fn_printdots "Applying workshopmap fix."
  53. sleep 1
  54. fn_printinfo "Applying workshopmap fix."
  55. sleep 1
  56. rm -f "${systemdir}/subscribed_collection_ids.txt"
  57. rm -f "${systemdir}/subscribed_file_ids.txt"
  58. rm -f "${systemdir}/ugc_collection_cache.txt"
  59. echo -en "\n"
  60. echo ""
  61. fi
  62. }
  63. if [ ! -z "${startfix}" ]; then
  64. fn_csgoappfix
  65. else
  66. fn_csgofixes
  67. fi