check.sh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/bash
  2. # LGSM check.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Overall function for managing checks.
  6. # Runs checks that will either halt on or fix an issue.
  7. local commandname="CHECK"
  8. # Every command that requires checks just references check.sh
  9. # check.sh selects which checks to run by using arrays
  10. check_root.sh
  11. check_tmuxception.sh
  12. check_permissions.sh
  13. if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]; then
  14. check_system_dir.sh
  15. fi
  16. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  17. for allowed_command in "${allowed_commands_array[@]}"
  18. do
  19. if [ "${allowed_command}" == "${function_selfname}" ]; then
  20. check_glibc.sh
  21. fi
  22. done
  23. local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_ut99_maps.sh command_monitor.sh command_start.sh command_stop.sh command_update.sh command_validate.sh command_update_functions.sh command_email_test.sh )
  24. for allowed_command in "${allowed_commands_array[@]}"
  25. do
  26. if [ "${allowed_command}" == "${function_selfname}" ]; then
  27. check_logs.sh
  28. fi
  29. done
  30. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
  31. for allowed_command in "${allowed_commands_array[@]}"
  32. do
  33. if [ "${allowed_command}" == "${function_selfname}" ]; then
  34. check_deps.sh
  35. fi
  36. done
  37. local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  38. for allowed_command in "${allowed_commands_array[@]}"
  39. do
  40. if [ "${allowed_command}" == "${function_selfname}" ]; then
  41. check_config.sh
  42. fi
  43. done
  44. local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  45. for allowed_command in "${allowed_commands_array[@]}"
  46. do
  47. if [ "${allowed_command}" == "${function_selfname}" ]; then
  48. check_ip.sh
  49. fi
  50. done
  51. local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh )
  52. for allowed_command in "${allowed_commands_array[@]}"
  53. do
  54. if [ "${allowed_command}" == "${function_selfname}" ]; then
  55. if [ -n "${appid}" ]; then
  56. check_steamcmd.sh
  57. fi
  58. fi
  59. done
  60. local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh command_update.sh command_details.sh command_validate.sh )
  61. for allowed_command in "${allowed_commands_array[@]}"
  62. do
  63. if [ "${allowed_command}" == "${function_selfname}" ]; then
  64. check_status.sh
  65. fi
  66. done
  67. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  68. for allowed_command in "${allowed_commands_array[@]}"
  69. do
  70. if [ "${allowed_command}" == "${function_selfname}" ]; then
  71. check_system_requirements.sh
  72. fi
  73. done