From 697f87eeb57baf0679b0877388f7bc9a8610c6eb Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Mon, 20 Nov 2023 17:53:43 +0530 Subject: [PATCH] make sure that the script runs as root --- create-image.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/create-image.sh b/create-image.sh index d14a88a..d3393fd 100755 --- a/create-image.sh +++ b/create-image.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash set -x + +if [[ "$(id -u)" -ne 0 ]]; then + >&2 echo "$0: please run this script as root" + exit 1 +fi + KICKSTART_BASE="Rocky" TODAY="$(TZ='UTC' date +%Y.%m.%d)" KICKSTART_FILE="${KICKSTART_BASE}.ks"