From 70d45a5c16e76433a95cf14fdda5e0b13ecdaea5 Mon Sep 17 00:00:00 2001 From: mattiaborsarini 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