check.sh 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 commandnane="CHECK"
  8. local commandaction="Checking"
  9. # Cannot have selfname as breaks the function.
  10. #local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  11. # Every command that requires checks just references check.sh
  12. # check.sh selects which checks to run by using arrays
  13. check_root.sh
  14. check_permissions.sh
  15. if [ "${selfname}" != "command_install.sh" ] && [ "${selfname}" != "command_update_functions.sh" ]; then
  16. check_system_dir.sh
  17. fi
  18. local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
  19. for allowed_command in "${allowed_commands_array[@]}"
  20. do
  21. if [ "${allowed_command}" == "${selfname}" ]; then
  22. check_glibc.sh
  23. fi
  24. done
  25. 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 )
  26. for allowed_command in "${allowed_commands_array[@]}"
  27. do
  28. if [ "${allowed_command}" == "${selfname}" ]; then
  29. check_logs.sh
  30. fi
  31. done
  32. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
  33. for allowed_command in "${allowed_commands_array[@]}"
  34. do
  35. if [ "${allowed_command}" == "${selfname}" ]; then
  36. check_deps.sh
  37. fi
  38. done
  39. local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  40. for allowed_command in "${allowed_commands_array[@]}"
  41. do
  42. if [ "${allowed_command}" == "${selfname}" ]; then
  43. check_ip.sh
  44. fi
  45. done
  46. local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh )
  47. for allowed_command in "${allowed_commands_array[@]}"
  48. do
  49. if [ "${allowed_command}" == "${selfname}" ]; then
  50. if [ -n "${appid}" ]; then
  51. check_steamcmd.sh
  52. fi
  53. fi
  54. done
  55. local allowed_commands_array=( command_console.sh command_start.sh )
  56. for allowed_command in "${allowed_commands_array[@]}"
  57. do
  58. if [ "${allowed_command}" == "${selfname}" ]; then
  59. check_tmux.sh
  60. fi
  61. done
  62. local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  63. for allowed_command in "${allowed_commands_array[@]}"
  64. do
  65. if [ "${allowed_command}" == "${selfname}" ]; then
  66. check_config.sh
  67. fi
  68. done
  69. 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 )
  70. for allowed_command in "${allowed_commands_array[@]}"
  71. do
  72. if [ "${allowed_command}" == "${selfname}" ]; then
  73. check_status.sh
  74. fi
  75. done