check.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. check_logs.sh
  28. fi
  29. done
  30. local allowed_commands_array=( debug details monitor start stop )
  31. for allowed_command in "${allowed_commands_array[@]}"
  32. do
  33. if [ "${allowed_command}" == "${getopt}" ]; then
  34. check_ip.sh
  35. fi
  36. done
  37. local allowed_commands_array=( debug install start stop update validate )
  38. for allowed_command in "${allowed_commands_array[@]}"
  39. do
  40. if [ "${allowed_command}" == "${getopt}" ]; then
  41. check_steamuser.sh
  42. check_steamcmd.sh
  43. fi
  44. done
  45. local allowed_commands_array=( console start stop )
  46. for allowed_command in "${allowed_commands_array[@]}"
  47. do
  48. if [ "${allowed_command}" == "${getopt}" ]; then
  49. check_tmux.sh
  50. fi
  51. done