From cc1a318e3dece2dab58c85dcdd5ec7387da86ecc Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 14 Apr 2019 17:03:04 -0700 Subject: [PATCH] Abort if not running as root --- .bin/Scripts/build-ufd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.bin/Scripts/build-ufd b/.bin/Scripts/build-ufd index 5542a0ac..38b6f8d6 100755 --- a/.bin/Scripts/build-ufd +++ b/.bin/Scripts/build-ufd @@ -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)