From fe6c9aa2b4a6a8f9dea8e0f4c3fa56b10c234018 Mon Sep 17 00:00:00 2001 From: Jesus Date: Mon, 25 Sep 2023 02:46:41 +0800 Subject: update helpers --- make-bootstrap-file.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'make-bootstrap-file.sh') diff --git a/make-bootstrap-file.sh b/make-bootstrap-file.sh index de42f67..2e0c883 100644 --- a/make-bootstrap-file.sh +++ b/make-bootstrap-file.sh @@ -4,16 +4,25 @@ set -e -u -o pipefail +# Check if the user is root (superuser) +if [[ $(id -u) -ne 0 ]]; then + echo "This script must be run as root (superuser) because it uses 'mknod' to make device nodes, which requires superuser privileges." + exit 1 +fi + +# Display usage message usage() { cat <