check.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/bash
  2. # LGSM fn_check function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="060116"
  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" ]; then
  21. check_systemdir.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 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_details.sh command_monitor.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_ip.sh
  35. fi
  36. done
  37. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh update_check.sh command_validate.sh )
  38. for allowed_command in "${allowed_commands_array[@]}"
  39. do
  40. if [ "${allowed_command}" == "${function_selfname}" ]; then
  41. if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Teamspeak 3" ]; then
  42. : # These servers do not require SteamCMD. Check is skipped.
  43. else
  44. check_steamcmd.sh
  45. fi
  46. fi
  47. done
  48. local allowed_commands_array=( command_console.sh command_start.sh command_stop.sh )
  49. for allowed_command in "${allowed_commands_array[@]}"
  50. do
  51. if [ "${allowed_command}" == "${function_selfname}" ]; then
  52. check_tmux.sh
  53. fi
  54. done
  55. local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.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_config.sh
  60. fi
  61. done