fix.sh 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #!/bin/bash
  2. # LinuxGSM fix.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Overall function for managing fixes.
  7. # Runs functions that will fix an issue.
  8. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  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 [ $? != 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 [ "${commandname}" != "INSTALL" ] && [ -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}" == "armar" ]; then
  37. fix_armar.sh
  38. elif [ "${shortname}" == "ark" ]; then
  39. fix_ark.sh
  40. elif [ "${shortname}" == "bo" ]; then
  41. fix_bo.sh
  42. elif [ "${shortname}" == "csgo" ]; then
  43. fix_csgo.sh
  44. elif [ "${shortname}" == "cmw" ]; then
  45. fix_cmw.sh
  46. elif [ "${shortname}" == "dst" ]; then
  47. fix_dst.sh
  48. elif [ "${shortname}" == "hw" ]; then
  49. fix_hw.sh
  50. elif [ "${shortname}" == "ins" ]; then
  51. fix_ins.sh
  52. elif [ "${shortname}" == "nmrih" ]; then
  53. fix_nmrih.sh
  54. elif [ "${shortname}" == "onset" ]; then
  55. fix_onset.sh
  56. elif [ "${shortname}" == "rust" ]; then
  57. fix_rust.sh
  58. elif [ "${shortname}" == "rw" ]; then
  59. fix_rw.sh
  60. elif [ "${shortname}" == "sdtd" ]; then
  61. fix_sdtd.sh
  62. elif [ "${shortname}" == "sfc" ]; then
  63. fix_sfc.sh
  64. elif [ "${shortname}" == "sof2" ]; then
  65. fix_sof2.sh
  66. elif [ "${shortname}" == "squad" ]; then
  67. fix_squad.sh
  68. elif [ "${shortname}" == "st" ]; then
  69. fix_st.sh
  70. elif [ "${shortname}" == "tf2" ]; then
  71. fix_tf2.sh
  72. elif [ "${shortname}" == "terraria" ]; then
  73. fix_terraria.sh
  74. elif [ "${shortname}" == "ts3" ]; then
  75. fix_ts3.sh
  76. elif [ "${shortname}" == "mcb" ]; then
  77. fix_mcb.sh
  78. elif [ "${shortname}" == "mta" ]; then
  79. fix_mta.sh
  80. elif [ "${shortname}" == "unt" ]; then
  81. fix_unt.sh
  82. elif [ "${shortname}" == "vh" ]; then
  83. fix_vh.sh
  84. elif [ "${shortname}" == "wurm" ]; then
  85. fix_wurm.sh
  86. elif [ "${shortname}" == "zmr" ]; then
  87. fix_zmr.sh
  88. fi
  89. fi
  90. # Fixes that are run on install only.
  91. if [ "${commandname}" == "INSTALL" ]; then
  92. if [ "${shortname}" == "av" ] || [ "${shortname}" == "cmw" ] || [ "${shortname}" == "kf" ] || [ "${shortname}" == "kf2" ] || [ "${shortname}" == "lo" ] || [ "${shortname}" == "onset" ] || [ "${shortname}" == "ro" ] || [ "${shortname}" == "samp" ] || [ "${shortname}" == "ut2k4" ] || [ "${shortname}" == "ut" ] || [ "${shortname}" == "ut3" ]; then
  93. echo -e ""
  94. echo -e "${lightyellow}Applying Post-Install Fixes${default}"
  95. echo -e "================================="
  96. fn_sleep_time
  97. postinstall=1
  98. if [ "${shortname}" == "av" ]; then
  99. fix_av.sh
  100. elif [ "${shortname}" == "kf" ]; then
  101. fix_kf.sh
  102. elif [ "${shortname}" == "kf2" ]; then
  103. fix_kf2.sh
  104. elif [ "${shortname}" == "lo" ]; then
  105. fix_lo.sh
  106. elif [ "${shortname}" == "ro" ]; then
  107. fix_ro.sh
  108. elif [ "${shortname}" == "samp" ]; then
  109. fix_samp.sh
  110. elif [ "${shortname}" == "ut2k4" ]; then
  111. fix_ut2k4.sh
  112. elif [ "${shortname}" == "ut" ]; then
  113. fix_ut.sh
  114. elif [ "${shortname}" == "ut3" ]; then
  115. fix_ut3.sh
  116. else
  117. fn_print_information_nl "No fixes required."
  118. fi
  119. fi
  120. fi