check.sh 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_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_ip.sh
  42. fi
  43. done
  44. local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh )
  45. for allowed_command in "${allowed_commands_array[@]}"
  46. do
  47. if [ "${allowed_command}" == "${function_selfname}" ]; then
  48. if [ -n "${appid}" ]; then
  49. check_steamcmd.sh
  50. fi
  51. fi
  52. done
  53. local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  54. for allowed_command in "${allowed_commands_array[@]}"
  55. do
  56. if [ "${allowed_command}" == "${function_selfname}" ]; then
  57. check_config.sh
  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