fix.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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}" == "Counter Strike: Global Offensive" ]; then
  33. fix_csgo.sh
  34. elif [ "${gamename}" == "Don't Starve Together" ]; then
  35. fix_dst.sh
  36. elif [ "${gamename}" == "Insurgency" ]; then
  37. fix_ins.sh
  38. elif [ "${gamename}" == "ARMA 3" ]; then
  39. fix_arma3.sh
  40. fi
  41. if [ "${gamename}" != "TeamSpeak 3" ]; then
  42. fix_glibc.sh
  43. fi
  44. fi
  45. # Fixes that are run on install only.
  46. if [ "${function_selfname}" == "command_install.sh" ]; then
  47. if [ "${gamename}" == "Killing Floor" ]; then
  48. echo ""
  49. echo "Applying ${gamename} Server Fixes"
  50. echo "================================="
  51. sleep 1
  52. fix_kf.sh
  53. elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
  54. echo ""
  55. echo "Applying ${gamename} Server Fixes"
  56. echo "================================="
  57. sleep 1
  58. fix_ro.sh
  59. elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
  60. echo ""
  61. echo "Applying ${gamename} Server Fixes"
  62. echo "================================="
  63. sleep 1
  64. fix_ut2k4.sh
  65. elif [ "${gamename}" == "Unreal Tournament 99" ]; then
  66. echo ""
  67. echo "Applying ${gamename} Server Fixes"
  68. echo "================================="
  69. sleep 1
  70. fix_ut99.sh
  71. fi
  72. fi