check.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 [ "${getopt}" != "install" ]||[ "${getopt}" != "auto-install" ]; then
  21. check_systemdir.sh
  22. fi
  23. local allowed_commands_array=( backup console debug details map-compressor monitor start stop update validate )
  24. for allowed_command in "${allowed_commands_array[@]}"
  25. do
  26. if [ "${allowed_command}" == "${getopt}" ]; then
  27. echo "OK logs"
  28. check_logs.sh
  29. fi
  30. done
  31. local allowed_commands_array=( debug details monitor start stop )
  32. for allowed_command in "${allowed_commands_array[@]}"
  33. do
  34. if [ "${allowed_command}" == "${getopt}" ]; then
  35. check_ip.sh
  36. fi
  37. done
  38. local allowed_commands_array=( debug install start stop update validate )
  39. for allowed_command in "${allowed_commands_array[@]}"
  40. do
  41. if [ "${allowed_command}" == "${getopt}" ]; then
  42. check_steamuser.sh
  43. check_steamcmd.sh
  44. fi
  45. done
  46. local allowed_commands_array=( console start stop )
  47. for allowed_command in "${allowed_commands_array[@]}"
  48. do
  49. if [ "${allowed_command}" == "${getopt}" ]; then
  50. check_tmux.sh
  51. fi
  52. done