check.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/bash
  2. # LGSM fn_check function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="170216"
  6. # Description: Overall function for managing checks.
  7. # Runs checks that will either halt on or fix an issue.
  8. array_contains () {
  9. local seeking=$1; shift
  10. local in=1
  11. for element; do
  12. if [ ${element} == ${seeking} ]; then
  13. in=0
  14. break
  15. fi
  16. done
  17. return $in
  18. }
  19. check_root.sh
  20. if [ "${function_selfname}" != "command_install.sh" ] && [ "${function_selfname}" != "command_update_functions.sh" ]; then
  21. check_system_dir.sh
  22. fi
  23. 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 )
  24. for allowed_command in "${allowed_commands_array[@]}"
  25. do
  26. if [ "${allowed_command}" == "${function_selfname}" ]; then
  27. check_logs.sh
  28. fi
  29. done
  30. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
  31. for allowed_command in "${allowed_commands_array[@]}"
  32. do
  33. if [ "${allowed_command}" == "${function_selfname}" ]; then
  34. check_deps.sh
  35. fi
  36. done
  37. local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.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_ip.sh
  42. fi
  43. done
  44. local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh )
  45. for allowed_command in "${allowed_commands_array[@]}"
  46. do
  47. if [ "${allowed_command}" == "${function_selfname}" ]; then
  48. if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Teamspeak 3" ]; then
  49. : # These servers do not require SteamCMD. Check is skipped.
  50. else
  51. check_steamcmd.sh
  52. fi
  53. fi
  54. done
  55. local allowed_commands_array=( command_console.sh command_start.sh command_stop.sh )
  56. for allowed_command in "${allowed_commands_array[@]}"
  57. do
  58. if [ "${allowed_command}" == "${function_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}" == "${function_selfname}" ]; then
  66. check_config.sh
  67. fi
  68. done