check.sh 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # LinuxGSM 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. if [ "${function_selfname}" != "command_monitor.sh" ]; then
  13. check_permissions.sh
  14. fi
  15. if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]&&[ "${function_selfname}" != "command_update_linuxgsm.sh" ]&&[ "${function_selfname}" != "command_details.sh" ]&&[ "${function_selfname}" != "command_postdetails.sh" ]; then
  16. check_system_dir.sh
  17. fi
  18. local allowed_commands_array=( command_start.sh )
  19. for allowed_command in "${allowed_commands_array[@]}"
  20. do
  21. if [ "${allowed_command}" == "${function_selfname}" ]; then
  22. check_executable.sh
  23. fi
  24. done
  25. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  26. for allowed_command in "${allowed_commands_array[@]}"
  27. do
  28. if [ "${allowed_command}" == "${function_selfname}" ]; then
  29. check_glibc.sh
  30. fi
  31. done
  32. local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh)
  33. for allowed_command in "${allowed_commands_array[@]}"
  34. do
  35. if [ "${allowed_command}" == "${function_selfname}" ]; then
  36. check_logs.sh
  37. fi
  38. done
  39. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
  40. for allowed_command in "${allowed_commands_array[@]}"
  41. do
  42. if [ "${allowed_command}" == "${function_selfname}" ]; then
  43. check_deps.sh
  44. fi
  45. done
  46. local allowed_commands_array=( command_console.sh command_debug.sh command_monitor.sh command_start.sh command_stop.sh )
  47. for allowed_command in "${allowed_commands_array[@]}"
  48. do
  49. if [ "${allowed_command}" == "${function_selfname}" ]; then
  50. check_config.sh
  51. fi
  52. done
  53. local allowed_commands_array=( 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. if [ -z "${installflag}" ]; then
  58. check_ip.sh
  59. fi
  60. fi
  61. done
  62. local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh )
  63. for allowed_command in "${allowed_commands_array[@]}"
  64. do
  65. if [ "${allowed_command}" == "${function_selfname}" ]; then
  66. if [ -n "${appid}" ]; then
  67. check_steamcmd.sh
  68. fi
  69. fi
  70. done
  71. 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 )
  72. for allowed_command in "${allowed_commands_array[@]}"
  73. do
  74. if [ "${allowed_command}" == "${function_selfname}" ]; then
  75. check_status.sh
  76. fi
  77. done
  78. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  79. for allowed_command in "${allowed_commands_array[@]}"
  80. do
  81. if [ "${allowed_command}" == "${function_selfname}" ]; then
  82. check_system_requirements.sh
  83. fi
  84. done