From 0e9231de6b020c5a4a28c33d83716cc49a6fc9c4 Mon Sep 17 00:00:00 2001 From: mattia Date: Wed, 11 Aug 2021 22:32:44 +0200 Subject: [PATCH] Only run as root --- setupfedora.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setupfedora.sh b/setupfedora.sh index ba4419a..536ff50 100755 --- a/setupfedora.sh +++ b/setupfedora.sh @@ -1,4 +1,10 @@ #!/bin/bash ### Setup Fedora ### # Abort on errors -set -e \ No newline at end of file +set -e + +# Check if the script is running as root +if [[ $UID != "0" ]]; then + echo "ERROR: You must run this script as root!" + exit 1 +fi \ No newline at end of file