check.sh 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. # LinuxGSM check.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.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. if [ "${userinput}" != "install" ]&&[ "${userinput}" != "auto-install" ]&&[ "${userinput}" != "i" ]&&[ "${userinput}" != "ai" ]; then
  11. check_root.sh
  12. fi
  13. check_tmuxception.sh
  14. if [ "$(whoami)" != "root" ]; then
  15. if [ "${function_selfname}" != "command_monitor.sh" ]; then
  16. check_permissions.sh
  17. fi
  18. fi
  19. 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
  20. check_system_dir.sh
  21. fi
  22. local allowed_commands_array=( command_start.sh )
  23. for allowed_command in "${allowed_commands_array[@]}"
  24. do
  25. if [ "${allowed_command}" == "${function_selfname}" ]; then
  26. check_executable.sh
  27. fi
  28. done
  29. if [ "$(whoami)" != "root" ]; then
  30. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  31. for allowed_command in "${allowed_commands_array[@]}"
  32. do
  33. if [ "${allowed_command}" == "${function_selfname}" ]; then
  34. check_glibc.sh
  35. fi
  36. done
  37. fi
  38. 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)
  39. for allowed_command in "${allowed_commands_array[@]}"
  40. do
  41. if [ "${allowed_command}" == "${function_selfname}" ]; then
  42. check_logs.sh
  43. fi
  44. done
  45. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
  46. for allowed_command in "${allowed_commands_array[@]}"
  47. do
  48. if [ "${allowed_command}" == "${function_selfname}" ]; then
  49. check_deps.sh
  50. fi
  51. done
  52. local allowed_commands_array=( command_console.sh command_debug.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_debug.sh command_details.sh command_postdetails.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh )
  60. for allowed_command in "${allowed_commands_array[@]}"
  61. do
  62. if [ "${allowed_command}" == "${function_selfname}" ]; then
  63. if [ -z "${installflag}" ]; then
  64. check_ip.sh
  65. fi
  66. fi
  67. done
  68. local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh )
  69. for allowed_command in "${allowed_commands_array[@]}"
  70. do
  71. if [ "${allowed_command}" == "${function_selfname}" ]; then
  72. if [ -n "${appid}" ]; then
  73. check_steamcmd.sh
  74. fi
  75. fi
  76. done
  77. 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 )
  78. for allowed_command in "${allowed_commands_array[@]}"
  79. do
  80. if [ "${allowed_command}" == "${function_selfname}" ]; then
  81. check_status.sh
  82. fi
  83. done
  84. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  85. for allowed_command in "${allowed_commands_array[@]}"
  86. do
  87. if [ "${allowed_command}" == "${function_selfname}" ]; then
  88. check_system_requirements.sh
  89. fi
  90. done