check.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. # LGSM fn_check function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="271215"
  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}" != "install" ]||[ "${function_selfname}" != "auto-install" ]; then
  21. check_systemdir.sh
  22. fi
  23. local denied_commands_array=( command_install.sh command_details.sh compress_unreal2_maps.sh compress_ut99_maps.sh )
  24. for denied_command in "${denied_commands_array[@]}"
  25. do
  26. if [ "${denied_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. check_steamcmd.sh
  42. fi
  43. done
  44. local allowed_commands_array=( command_console.sh command_start.sh command_stop.sh )
  45. for allowed_command in "${allowed_commands_array[@]}"
  46. do
  47. if [ "${allowed_command}" == "${function_selfname}" ]; then
  48. check_tmux.sh
  49. fi
  50. done