check.sh 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/bash
  2. # LGSM fn_check 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 modulename="Checking"
  8. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  9. # Every command that requires checks just references check.sh
  10. # check.sh selects which checks to run by using arrays
  11. check_root.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 update_check.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_check.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_start.sh )
  54. for allowed_command in "${allowed_commands_array[@]}"
  55. do
  56. if [ "${allowed_command}" == "${function_selfname}" ]; then
  57. check_tmux.sh
  58. fi
  59. done
  60. local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  61. for allowed_command in "${allowed_commands_array[@]}"
  62. do
  63. if [ "${allowed_command}" == "${function_selfname}" ]; then
  64. check_config.sh
  65. fi
  66. done
  67. local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh update_check.sh command_details.sh command_validate.sh )
  68. for allowed_command in "${allowed_commands_array[@]}"
  69. do
  70. if [ "${allowed_command}" == "${function_selfname}" ]; then
  71. check_status.sh
  72. fi
  73. done