fix.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. # LinuxGSM fix.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.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 0.5
  13. fn_print_info "Applying ${fixname} fix: ${gamename}"
  14. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  15. sleep 0.5
  16. }
  17. fn_fix_msg_start_nl(){
  18. fn_print_dots "Applying ${fixname} fix: ${gamename}"
  19. sleep 0.5
  20. fn_print_info "Applying ${fixname} fix: ${gamename}"
  21. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  22. sleep 0.5
  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. else
  29. fn_print_ok_nl "Applying ${fixname} fix: ${gamename}"
  30. fn_script_log_pass "Applying ${fixname} fix: ${gamename}"
  31. fi
  32. }
  33. # Fixes that are run on start
  34. if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then
  35. if [ -n "${appid}" ]; then
  36. fix_steamcmd.sh
  37. fi
  38. if [ "${shortname}" == "arma3" ]; then
  39. fix_arma3.sh
  40. elif [ "${shortname}" == "ark" ]; then
  41. fix_ark.sh
  42. elif [ "${shortname}" == "csgo" ]; then
  43. fix_csgo.sh
  44. elif [ "${shortname}" == "dst" ]; then
  45. fix_dst.sh
  46. elif [ "${shortname}" == "ges" ]; then
  47. fix_ges.sh
  48. elif [ "${shortname}" == "ins" ]; then
  49. fix_ins.sh
  50. elif [ "${shortname}" == "rust" ]; then
  51. fix_rust.sh
  52. elif [ "${shortname}" == "rw" ]; then
  53. fix_rw.sh
  54. elif [ "${shortname}" == "sdtd" ]; then
  55. fix_sdtd.sh
  56. elif [ "${shortname}" == "ss3" ]; then
  57. fix_ss3.sh
  58. elif [ "${shortname}" == "ts3" ]; then
  59. fix_ts3.sh
  60. elif [ "${shortname}" == "mta" ]; then
  61. fix_mta.sh
  62. elif [ "${shortname}" == "wurm" ]; then
  63. fix_wurm.sh
  64. fi
  65. fi
  66. # Fixes that are run on install only.
  67. if [ "${function_selfname}" == "command_install.sh" ]; then
  68. echo ""
  69. echo "Applying Post-Install Fixes"
  70. echo "================================="
  71. sleep 0.5
  72. if [ "${shortname}" == "kf" ]; then
  73. fix_kf.sh
  74. elif [ "${shortname}" == "kf2" ]; then
  75. fix_kf2.sh
  76. elif [ "${shortname}" == "ro" ]; then
  77. fix_ro.sh
  78. elif [ "${shortname}" == "ut2k4" ]; then
  79. fix_ut2k4.sh
  80. elif [ "${shortname}" == "ut" ]; then
  81. fix_ut.sh
  82. elif [ "${shortname}" == "ut3" ]; then
  83. fix_ut3.sh
  84. elif [ "${shortname}" == "tf2" ]; then
  85. fix_tf2.sh
  86. else
  87. fn_print_information_nl "No fixes required."
  88. fi
  89. fi