fix.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. # LGSM fix.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Overall function for managing fixes.
  6. # Runs functions that will fix an issue.
  7. local commandnane="FIX"
  8. local commandaction="Fix"
  9. # Cannot have selfname as breaks if statements.
  10. #local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  11. # Messages that are displayed for some fixes
  12. fn_fix_msg_start(){
  13. fn_print_dots "Applying ${fixname} fix: ${gamename}"
  14. sleep 1
  15. fn_print_info "Applying ${fixname} fix: ${gamename}"
  16. fn_script_log_info "Applying ${fixname} fix: ${gamename}"
  17. sleep 1
  18. }
  19. fn_fix_msg_end(){
  20. if [ $? -ne 0 ]; then
  21. fn_print_fail_nl "Applying ${fixname} fix: ${gamename}"
  22. fn_script_log_error "Applying ${fixname} fix: ${gamename}"
  23. exitcode=2
  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 [ "${selfname}" != "command_install.sh" ]; then
  31. if [ -n "${appid}" ]; then
  32. fix_steamcmd.sh
  33. fi
  34. if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
  35. fix_csgo.sh
  36. elif [ "${gamename}" == "Don't Starve Together" ]; then
  37. fix_dst.sh
  38. elif [ "${gamename}" == "Insurgency" ]; then
  39. fix_ins.sh
  40. elif [ "${gamename}" == "ARMA 3" ]; then
  41. fix_arma3.sh
  42. fi
  43. if [ "${gamename}" != "Teamspeak 3" ]; then
  44. fix_glibc.sh
  45. fi
  46. fi
  47. # Fixes that are run on install only.
  48. if [ "${selfname}" == "command_install.sh" ]; then
  49. if [ "${gamename}" == "Killing Floor" ]; then
  50. echo ""
  51. echo "Applying ${gamename} Server Fixes"
  52. echo "================================="
  53. sleep 1
  54. fix_kf.sh
  55. elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
  56. echo ""
  57. echo "Applying ${gamename} Server Fixes"
  58. echo "================================="
  59. sleep 1
  60. fix_ro.sh
  61. elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
  62. echo ""
  63. echo "Applying ${gamename} Server Fixes"
  64. echo "================================="
  65. sleep 1
  66. fix_ut2k4.sh
  67. elif [ "${gamename}" == "Unreal Tournament 99" ]; then
  68. echo ""
  69. echo "Applying ${gamename} Server Fixes"
  70. echo "================================="
  71. sleep 1
  72. fix_ut99.sh
  73. fi
  74. fi