check_root.sh 410 B

123456789101112131415
  1. #!/bin/bash
  2. # LGSM check_root.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. local commandname="CHECK"
  6. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  7. if [ $(whoami) = "root" ]; then
  8. fn_print_fail_nl "Do NOT run this script as root!"
  9. if [ -d "${scriptlogdir}" ]; then
  10. fn_script_log_fatal "${selfname} attempted to run as root."
  11. fi
  12. core_exit.sh
  13. fi