core_exit.sh 677 B

1234567891011121314151617181920212223
  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 [ "${exitcode}" != "0" ]; then
  8. if [ "${exitcode}" == "1" ]; then
  9. fn_script_log_fatal "Exiting with exit code: ${exitcode}"
  10. elif [ "${exitcode}" == "2" ]; then
  11. fn_script_log_error "Exiting with exit code: ${exitcode}"
  12. elif [ "${exitcode}" == "3" ]; then
  13. fn_script_log_warn "Exiting with exit code: ${exitcode}"
  14. else
  15. fn_script_log "Exiting with exit code: ${exitcode}"
  16. fi
  17. else
  18. fn_script_log_pass "Exiting with exit code: ${exitcode}"
  19. fi
  20. exit ${exitcode}