diff options
author | Jesus <heckyel@riseup.net> | 2023-09-25 03:12:56 +0800 |
---|---|---|
committer | Jesus <heckyel@riseup.net> | 2023-09-25 03:12:56 +0800 |
commit | 04fc009cbdb00f8272fc0ccda878ee19b90e3436 (patch) | |
tree | d43546b4ea09503bc446f77e91e068e7786db6c4 | |
parent | 19b520487d125e5bcd4d07cd2849126a2f23c8ea (diff) | |
download | hyperbola-bootstrap-04fc009cbdb00f8272fc0ccda878ee19b90e3436.tar.lz hyperbola-bootstrap-04fc009cbdb00f8272fc0ccda878ee19b90e3436.tar.xz hyperbola-bootstrap-04fc009cbdb00f8272fc0ccda878ee19b90e3436.zip |
Flexible to access -h option without root
-rw-r--r-- | make-bootstrap-file.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/make-bootstrap-file.sh b/make-bootstrap-file.sh index 5153150..efc62b6 100644 --- a/make-bootstrap-file.sh +++ b/make-bootstrap-file.sh @@ -4,12 +4,6 @@ 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 <<EOF @@ -75,6 +69,12 @@ while [[ $# -gt 0 ]]; do esac done +# 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 + # Set ROOTFS ROOTFS="$ARCH" |