check.sh 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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_start.sh )
  17. for allowed_command in "${allowed_commands_array[@]}"
  18. do
  19. if [ "${allowed_command}" == "${function_selfname}" ]; then
  20. check_executable.sh
  21. fi
  22. done
  23. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  24. for allowed_command in "${allowed_commands_array[@]}"
  25. do
  26. if [ "${allowed_command}" == "${function_selfname}" ]; then
  27. check_glibc.sh
  28. fi
  29. done
  30. 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 command_mods_install.sh command_mods_update.sh command_mods_remove.sh )
  31. for allowed_command in "${allowed_commands_array[@]}"
  32. do
  33. if [ "${allowed_command}" == "${function_selfname}" ]; then
  34. check_logs.sh
  35. fi
  36. done
  37. local allowed_commands_array=( command_debug.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_deps.sh
  42. fi
  43. done
  44. local allowed_commands_array=( command_console.sh 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_config.sh
  49. fi
  50. done
  51. local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  52. for allowed_command in "${allowed_commands_array[@]}"
  53. do
  54. if [ "${allowed_command}" == "${function_selfname}" ]; then
  55. check_ip.sh
  56. fi
  57. done
  58. local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh )
  59. for allowed_command in "${allowed_commands_array[@]}"
  60. do
  61. if [ "${allowed_command}" == "${function_selfname}" ]; then
  62. if [ -n "${appid}" ]; then
  63. check_steamcmd.sh
  64. fi
  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 command_update.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
  74. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  75. for allowed_command in "${allowed_commands_array[@]}"
  76. do
  77. if [ "${allowed_command}" == "${function_selfname}" ]; then
  78. check_system_requirements.sh
  79. fi
  80. done