check_root.sh 431 B

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