From 9beb44a5f80383de37377c955a2650de03d5a68e Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 28 Nov 2023 22:46:55 +0100 Subject: [PATCH] abort if not running as root --- build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sh b/build.sh index 493ebea..f83d7b3 100755 --- a/build.sh +++ b/build.sh @@ -12,6 +12,11 @@ cleanup() { rm -R ${TMP_DIR}/rw $IMAGE_MOUNT_DIR $ROOT_MOUNT_DIR } +if [ $(id -u) != "0" ]; then + echo "ERROR: requires root privileges" + exit 1 +fi + # handle arguments while [ ${#} -gt 0 ]; do case "${1}" in