check.sh 2.8 KB

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