fix.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. # Messages that are displayed for some fixes
  10. fn_fix_msg_start(){
  11. fn_print_dots "Applying ${fixname} fix: ${gamename}"
  12. sleep 1
  13. fn_print_info "Applying ${fixname} fix: ${gamename}"
  14. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  15. sleep 1
  16. }
  17. fn_fix_msg_end(){
  18. if [ $? -ne 0 ]; then
  19. fn_print_error_nl "Applying ${fixname} fix: ${gamename}"
  20. fn_script_log_error "Applying ${fixname} fix: ${gamename}"
  21. exitcode=2
  22. else
  23. fn_print_ok_nl "Applying ${fixname} fix: ${gamename}"
  24. fn_script_log_pass "Applying ${fixname} fix: ${gamename}"
  25. fi
  26. }
  27. # Fixes that are run on start
  28. if [ "${function_selfname}" != "command_install.sh" ]; then
  29. if [ -n "${appid}" ]; then
  30. fix_steamcmd.sh
  31. fi
  32. if [ "${gamename}" == "ARMA 3" ]; then
  33. fix_arma3.sh
  34. elif [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
  35. fix_csgo.sh
  36. elif [ "${gamename}" == "Don't Starve Together" ]; then
  37. fix_dst.sh
  38. elif [ "${gamename}" == "GoldenEye: Source" ]; then
  39. fix_ges.sh
  40. elif [ "${gamename}" == "Insurgency" ]; then
  41. fix_ins.sh
  42. fi
  43. fi
  44. # Fixes that are run on install only.
  45. if [ "${function_selfname}" == "command_install.sh" ]; then
  46. if [ "${gamename}" == "Killing Floor" ]; then
  47. echo ""
  48. echo "Applying ${gamename} Server Fixes"
  49. echo "================================="
  50. sleep 1
  51. fix_kf.sh
  52. elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
  53. echo ""
  54. echo "Applying ${gamename} Server Fixes"
  55. echo "================================="
  56. sleep 1
  57. fix_ro.sh
  58. elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
  59. echo ""
  60. echo "Applying ${gamename} Server Fixes"
  61. echo "================================="
  62. sleep 1
  63. fix_ut2k4.sh
  64. elif [ "${gamename}" == "Unreal Tournament 99" ]; then
  65. echo ""
  66. echo "Applying ${gamename} Server Fixes"
  67. echo "================================="
  68. sleep 1
  69. fix_ut99.sh
  70. elif [ "${gamename}" == "Unreal Tournament" ]; then
  71. echo ""
  72. echo "Applying ${gamename} Server Fixes"
  73. echo "================================="
  74. sleep 1
  75. fix_ut.sh
  76. fi
  77. fi