core_exit.sh 732 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. # LGSM core_exit.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. lgsm_version="210516"
  6. # Description: handles exiting of LGSM by running and reporting an exit code.
  7. if [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
  8. if [ "${exitcode}" == "1" ]; then
  9. fn_script_log_fatal "Exiting with code: ${exitcode}"
  10. elif [ "${exitcode}" == "2" ]; then
  11. fn_script_log_error "Exiting with code: ${exitcode}"
  12. elif [ "${exitcode}" == "3" ]; then
  13. fn_script_log_warn "Exiting with code: ${exitcode}"
  14. else
  15. fn_script_log_warn "Exiting with code: ${exitcode}"
  16. fi
  17. exit ${exitcode}
  18. else
  19. exitcode=0
  20. fi
  21. if [ -f "${rootdir}/.dev-debug" ]; then
  22. sleep 0.5
  23. echo "Exiting with code: ${exitcode}"
  24. fi