check.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. # LGSM fn_check function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="060316"
  6. # Description: Overall function for managing checks.
  7. # Runs checks that will either halt on or fix an issue.
  8. # Every command that requires checks just references check.sh
  9. # check.sh selects which checks to run by using arrays
  10. check_root.sh
  11. check_permissions.sh
  12. if [ "${function_selfname}" != "command_install.sh" ] && [ "${function_selfname}" != "command_update_functions.sh" ]; then
  13. check_system_dir.sh
  14. fi
  15. 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 )
  16. for allowed_command in "${allowed_commands_array[@]}"
  17. do
  18. if [ "${allowed_command}" == "${function_selfname}" ]; then
  19. check_logs.sh
  20. fi
  21. done
  22. local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
  23. for allowed_command in "${allowed_commands_array[@]}"
  24. do
  25. if [ "${allowed_command}" == "${function_selfname}" ]; then
  26. check_deps.sh
  27. fi
  28. done
  29. local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  30. for allowed_command in "${allowed_commands_array[@]}"
  31. do
  32. if [ "${allowed_command}" == "${function_selfname}" ]; then
  33. check_ip.sh
  34. fi
  35. done
  36. local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh )
  37. for allowed_command in "${allowed_commands_array[@]}"
  38. do
  39. if [ "${allowed_command}" == "${function_selfname}" ]; then
  40. if [ -n "${appid}" ]; then
  41. check_steamcmd.sh
  42. fi
  43. fi
  44. done
  45. local allowed_commands_array=( command_console.sh command_start.sh )
  46. for allowed_command in "${allowed_commands_array[@]}"
  47. do
  48. if [ "${allowed_command}" == "${function_selfname}" ]; then
  49. check_tmux.sh
  50. fi
  51. done
  52. local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
  53. for allowed_command in "${allowed_commands_array[@]}"
  54. do
  55. if [ "${allowed_command}" == "${function_selfname}" ]; then
  56. check_config.sh
  57. fi
  58. done