Abort if not running as root

This commit is contained in:
2Shirt 2019-04-14 17:03:04 -07:00
parent 6734460d42
commit cc1a318e3d
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -42,6 +42,11 @@ def get_user_name():
# Main section
if __name__ == '__main__':
# Check if running as root
if os.geteuid() != 0:
print_error('ERROR: This script is meant to be run as root.')
abort(False)
# Docopt
try:
args = docopt(DOCSTRING)