fix.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Messages that are displayed for some fixes.
  9. fn_fix_msg_start(){
  10. fn_print_dots "Applying ${fixname} fix: ${gamename}"
  11. fn_print_info "Applying ${fixname} fix: ${gamename}"
  12. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  13. }
  14. fn_fix_msg_start_nl(){
  15. fn_print_dots "Applying ${fixname} fix: ${gamename}"
  16. fn_print_info "Applying ${fixname} fix: ${gamename}"
  17. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  18. }
  19. fn_fix_msg_end(){
  20. if [ $? != 0 ]; then
  21. fn_print_error_nl "Applying ${fixname} fix: ${gamename}"
  22. fn_script_log_error "Applying ${fixname} fix: ${gamename}"
  23. else
  24. fn_print_ok_nl "Applying ${fixname} fix: ${gamename}"
  25. fn_script_log_pass "Applying ${fixname} fix: ${gamename}"
  26. fi
  27. }
  28. # Fixes that are run on start.
  29. if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then
  30. if [ "${appid}" ]; then
  31. fix_steamcmd.sh
  32. fi
  33. if [ "${shortname}" == "arma3" ]; then
  34. fix_arma3.sh
  35. elif [ "${shortname}" == "ark" ]; then
  36. fix_ark.sh
  37. elif [ "${shortname}" == "csgo" ]; then
  38. fix_csgo.sh
  39. elif [ "${shortname}" == "cmw" ]; then
  40. fix_cmw.sh
  41. elif [ "${shortname}" == "dst" ]; then
  42. fix_dst.sh
  43. elif [ "${shortname}" == "ges" ]; then
  44. fix_ges.sh
  45. elif [ "${shortname}" == "hw" ]; then
  46. fix_hw.sh
  47. elif [ "${shortname}" == "ins" ]; then
  48. fix_ins.sh
  49. elif [ "${shortname}" == "nmrih" ]; then
  50. fix_nmrih.sh
  51. elif [ "${shortname}" == "onset" ]; then
  52. fix_onset.sh
  53. elif [ "${shortname}" == "rust" ]; then
  54. fix_rust.sh
  55. elif [ "${shortname}" == "rw" ]; then
  56. fix_rw.sh
  57. elif [ "${shortname}" == "sdtd" ]; then
  58. fix_sdtd.sh
  59. elif [ "${shortname}" == "sfc" ]; then
  60. fix_sfc.sh
  61. elif [ "${shortname}" == "sof2" ]; then
  62. fix_sof2.sh
  63. elif [ "${shortname}" == "ss3" ]; then
  64. fix_ss3.sh
  65. elif [ "${shortname}" == "tf2" ]; then
  66. fix_tf2.sh
  67. elif [ "${shortname}" == "terraria" ]; then
  68. fix_terraria.sh
  69. elif [ "${shortname}" == "ts3" ]; then
  70. fix_ts3.sh
  71. elif [ "${shortname}" == "tu" ]; then
  72. fix_tu.sh
  73. elif [ "${shortname}" == "mcb" ]; then
  74. fix_mcb.sh
  75. elif [ "${shortname}" == "mta" ]; then
  76. fix_mta.sh
  77. elif [ "${shortname}" == "unt" ]; then
  78. fix_unt.sh
  79. elif [ "${shortname}" == "wurm" ]; then
  80. fix_wurm.sh
  81. elif [ "${shortname}" == "zmr" ]; then
  82. fix_zmr.sh
  83. fi
  84. fi
  85. # Fixes that are run on install only.
  86. if [ "${commandname}" == "INSTALL" ]; then
  87. if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
  88. echo -e ""
  89. echo -e "Applying Post-Install Fixes"
  90. echo -e "================================="
  91. fn_sleep_time
  92. postinstall=1
  93. if [ "${shortname}" == "av" ]; then
  94. fix_av.sh
  95. elif [ "${shortname}" == "kf" ]; then
  96. fix_kf.sh
  97. elif [ "${shortname}" == "kf2" ]; then
  98. fix_kf2.sh
  99. elif [ "${shortname}" == "ro" ]; then
  100. fix_ro.sh
  101. elif [ "${shortname}" == "ut2k4" ]; then
  102. fix_ut2k4.sh
  103. elif [ "${shortname}" == "ut" ]; then
  104. fix_ut.sh
  105. elif [ "${shortname}" == "ut3" ]; then
  106. fix_ut3.sh
  107. else
  108. fn_print_information_nl "No fixes required."
  109. fi
  110. fi
  111. fi