Flexible to access -h option without root
This commit is contained in:
parent
19b520487d
commit
04fc009cbd
@ -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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user