fix.sh 2.4 KB

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