fix.sh 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. 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 [ -n "${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}" == "rust" ]; then
  47. fix_rust.sh
  48. elif [ "${shortname}" == "rw" ]; then
  49. fix_rw.sh
  50. elif [ "${shortname}" == "sdtd" ]; then
  51. fix_sdtd.sh
  52. elif [ "${shortname}" == "ss3" ]; then
  53. fix_ss3.sh
  54. elif [ "${shortname}" == "tf2" ]; then
  55. fix_tf2.sh
  56. elif [ "${shortname}" == "terraria" ]; then
  57. fix_terraria.sh
  58. elif [ "${shortname}" == "ts3" ]; then
  59. fix_ts3.sh
  60. elif [ "${shortname}" == "mta" ]; then
  61. fix_mta.sh
  62. elif [ "${shortname}" == "unt" ]; then
  63. fix_unt.sh
  64. elif [ "${shortname}" == "wurm" ]; then
  65. fix_wurm.sh
  66. fi
  67. fi
  68. # Fixes that are run on install only.
  69. if [ "${function_selfname}" == "command_install.sh" ]; then
  70. if [ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
  71. echo ""
  72. echo "Applying Post-Install Fixes"
  73. echo "================================="
  74. fn_sleep_time
  75. if [ "${shortname}" == "kf" ]; then
  76. fix_kf.sh
  77. elif [ "${shortname}" == "kf2" ]; then
  78. fix_kf2.sh
  79. elif [ "${shortname}" == "ro" ]; then
  80. fix_ro.sh
  81. elif [ "${shortname}" == "ut2k4" ]; then
  82. fix_ut2k4.sh
  83. elif [ "${shortname}" == "ut" ]; then
  84. fix_ut.sh
  85. elif [ "${shortname}" == "ut3" ]; then
  86. fix_ut3.sh
  87. else
  88. fn_print_information_nl "No fixes required."
  89. fi
  90. fi
  91. fi