fix.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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}" == "tf2" ]; then
  59. fix_tf2.sh
  60. elif [ "${shortname}" == "terraria" ]; then
  61. fix_terraria.sh
  62. elif [ "${shortname}" == "ts3" ]; then
  63. fix_ts3.sh
  64. elif [ "${shortname}" == "mta" ]; then
  65. fix_mta.sh
  66. elif [ "${shortname}" == "wurm" ]; then
  67. fix_wurm.sh
  68. fi
  69. fi
  70. # Fixes that are run on install only.
  71. if [ "${function_selfname}" == "command_install.sh" ]; then
  72. if [ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
  73. echo ""
  74. echo "Applying Post-Install Fixes"
  75. echo "================================="
  76. sleep 0.5
  77. if [ "${shortname}" == "kf" ]; then
  78. fix_kf.sh
  79. elif [ "${shortname}" == "kf2" ]; then
  80. fix_kf2.sh
  81. elif [ "${shortname}" == "ro" ]; then
  82. fix_ro.sh
  83. elif [ "${shortname}" == "ut2k4" ]; then
  84. fix_ut2k4.sh
  85. elif [ "${shortname}" == "ut" ]; then
  86. fix_ut.sh
  87. elif [ "${shortname}" == "ut3" ]; then
  88. fix_ut3.sh
  89. else
  90. fn_print_information_nl "No fixes required."
  91. fi
  92. fi
  93. fi