fix.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # LGSM fix.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Overall function for managing fixes.
  6. # Runs functions that will fix an issue.
  7. local commandname="FIX"
  8. local commandaction="Fix"
  9. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  10. # Messages that are displayed for some fixes
  11. fn_fix_msg_start(){
  12. fn_print_dots "Applying ${fixname} fix: ${gamename}"
  13. sleep 1
  14. fn_print_info "Applying ${fixname} fix: ${gamename}"
  15. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  16. sleep 1
  17. }
  18. fn_fix_msg_end(){
  19. if [ $? -ne 0 ]; then
  20. fn_print_error_nl "Applying ${fixname} fix: ${gamename}"
  21. fn_script_log_error "Applying ${fixname} fix: ${gamename}"
  22. exitcode=2
  23. else
  24. fn_print_ok_nl "Applying ${fixname} fix: ${gamename}"
  25. fn_script_log_pass "Applying ${fixname} fix: ${gamename}"
  26. fi
  27. }
  28. # Fixes that are run on start
  29. if [ "${function_selfname}" != "command_install.sh" ]; then
  30. if [ -n "${appid}" ]; then
  31. fix_steamcmd.sh
  32. fi
  33. if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
  34. fix_csgo.sh
  35. elif [ "${gamename}" == "Don't Starve Together" ]; then
  36. fix_dst.sh
  37. elif [ "${gamename}" == "Insurgency" ]; then
  38. fix_ins.sh
  39. elif [ "${gamename}" == "ARMA 3" ]; then
  40. fix_arma3.sh
  41. fi
  42. if [ "${gamename}" != "Teamspeak 3" ]; then
  43. fix_glibc.sh
  44. fi
  45. fi
  46. # Fixes that are run on install only.
  47. if [ "${function_selfname}" == "command_install.sh" ]; then
  48. if [ "${gamename}" == "Killing Floor" ]; then
  49. echo ""
  50. echo "Applying ${gamename} Server Fixes"
  51. echo "================================="
  52. sleep 1
  53. fix_kf.sh
  54. elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
  55. echo ""
  56. echo "Applying ${gamename} Server Fixes"
  57. echo "================================="
  58. sleep 1
  59. fix_ro.sh
  60. elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
  61. echo ""
  62. echo "Applying ${gamename} Server Fixes"
  63. echo "================================="
  64. sleep 1
  65. fix_ut2k4.sh
  66. elif [ "${gamename}" == "Unreal Tournament 99" ]; then
  67. echo ""
  68. echo "Applying ${gamename} Server Fixes"
  69. echo "================================="
  70. sleep 1
  71. fix_ut99.sh
  72. fi
  73. fi