fix.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 modulename="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. fn_print_info "Applying ${fixname} fix: ${gamename}"
  13. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  14. }
  15. fn_fix_msg_start_nl(){
  16. fn_print_dots "Applying ${fixname} fix: ${gamename}"
  17. fn_print_info "Applying ${fixname} fix: ${gamename}"
  18. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  19. }
  20. fn_fix_msg_end(){
  21. if [ $? -ne 0 ]; then
  22. fn_print_error_nl "Applying ${fixname} fix: ${gamename}"
  23. fn_script_log_error "Applying ${fixname} fix: ${gamename}"
  24. else
  25. fn_print_ok_nl "Applying ${fixname} fix: ${gamename}"
  26. fn_script_log_pass "Applying ${fixname} fix: ${gamename}"
  27. fi
  28. }
  29. # Fixes that are run on start.
  30. if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then
  31. if [ "${appid}" ]; then
  32. fix_steamcmd.sh
  33. fi
  34. if [ "${shortname}" == "arma3" ]; then
  35. fix_arma3.sh
  36. elif [ "${shortname}" == "ark" ]; then
  37. fix_ark.sh
  38. elif [ "${shortname}" == "csgo" ]; then
  39. fix_csgo.sh
  40. elif [ "${shortname}" == "dst" ]; then
  41. fix_dst.sh
  42. elif [ "${shortname}" == "ges" ]; then
  43. fix_ges.sh
  44. elif [ "${shortname}" == "ins" ]; then
  45. fix_ins.sh
  46. elif [ "${shortname}" == "nmrih" ]; then
  47. fix_nmrih.sh
  48. elif [ "${shortname}" == "onset" ]; then
  49. fix_onset.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}" == "sfc" ]; then
  57. fix_sfc.sh
  58. elif [ "${shortname}" == "sof2" ]; then
  59. fix_sof2.sh
  60. elif [ "${shortname}" == "ss3" ]; then
  61. fix_ss3.sh
  62. elif [ "${shortname}" == "tf2" ]; then
  63. fix_tf2.sh
  64. elif [ "${shortname}" == "terraria" ]; then
  65. fix_terraria.sh
  66. elif [ "${shortname}" == "ts3" ]; then
  67. fix_ts3.sh
  68. elif [ "${shortname}" == "mcb" ]; then
  69. fix_mcb.sh
  70. elif [ "${shortname}" == "mta" ]; then
  71. fix_mta.sh
  72. elif [ "${shortname}" == "unt" ]; then
  73. fix_unt.sh
  74. elif [ "${shortname}" == "wurm" ]; then
  75. fix_wurm.sh
  76. elif [ "${shortname}" == "zmr" ]; then
  77. fix_zmr.sh
  78. fi
  79. fi
  80. # Fixes that are run on install only.
  81. if [ "${function_selfname}" == "command_install.sh" ]; then
  82. if [ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
  83. echo -e ""
  84. echo -e "Applying Post-Install Fixes"
  85. echo -e "================================="
  86. fn_sleep_time
  87. if [ "${shortname}" == "kf" ]; then
  88. fix_kf.sh
  89. elif [ "${shortname}" == "kf2" ]; then
  90. fix_kf2.sh
  91. elif [ "${shortname}" == "ro" ]; then
  92. fix_ro.sh
  93. elif [ "${shortname}" == "ut2k4" ]; then
  94. fix_ut2k4.sh
  95. elif [ "${shortname}" == "ut" ]; then
  96. fix_ut.sh
  97. elif [ "${shortname}" == "ut3" ]; then
  98. fix_ut3.sh
  99. else
  100. fn_print_information_nl "No fixes required."
  101. fi
  102. fi
  103. fi