check.sh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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_permissions.sh
  12. if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]; then
  13. check_system_dir.sh
  14. fi
  15. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  16. for allowed_command in "${allowed_commands_array[@]}"
  17. do
  18. if [ "${allowed_command}" == "${function_selfname}" ]; then
  19. check_glibc.sh
  20. fi
  21. done
  22. 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 update_check.sh command_validate.sh command_update_functions.sh command_email_test.sh )
  23. for allowed_command in "${allowed_commands_array[@]}"
  24. do
  25. if [ "${allowed_command}" == "${function_selfname}" ]; then
  26. check_logs.sh
  27. fi
  28. done
  29. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
  30. for allowed_command in "${allowed_commands_array[@]}"
  31. do
  32. if [ "${allowed_command}" == "${function_selfname}" ]; then
  33. check_deps.sh
  34. fi
  35. done
  36. local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  37. for allowed_command in "${allowed_commands_array[@]}"
  38. do
  39. if [ "${allowed_command}" == "${function_selfname}" ]; then
  40. check_ip.sh
  41. fi
  42. done
  43. local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh )
  44. for allowed_command in "${allowed_commands_array[@]}"
  45. do
  46. if [ "${allowed_command}" == "${function_selfname}" ]; then
  47. if [ -n "${appid}" ]; then
  48. check_steamcmd.sh
  49. fi
  50. fi
  51. done
  52. local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  53. for allowed_command in "${allowed_commands_array[@]}"
  54. do
  55. if [ "${allowed_command}" == "${function_selfname}" ]; then
  56. check_config.sh
  57. fi
  58. done
  59. 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 )
  60. for allowed_command in "${allowed_commands_array[@]}"
  61. do
  62. if [ "${allowed_command}" == "${function_selfname}" ]; then
  63. check_status.sh
  64. fi
  65. done
  66. local allowed_commands_array=( command_install.sh command_start.sh command_debug.sh )
  67. for allowed_command in "${allowed_commands_array[@]}"
  68. do
  69. if [ "${allowed_command}" == "${function_selfname}" ]; then
  70. check_system_requirements.sh
  71. fi
  72. done