Flexible to access -h option without root

This commit is contained in:
Jesus 2023-09-25 03:12:56 +08:00
parent 19b520487d
commit 04fc009cbd
No known key found for this signature in database
GPG Key ID: E607CE7149F4D71C

View File

@ -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"