]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Refactor the root user check
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Jul 2024 18:23:14 +0000 (18:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jul 2024 15:39:43 +0000 (15:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 41476ce3b5bc2827ba7b4bcf3ca87f2eaf33d348..7f3333a2149d6b4a7ffdb3e2cf5ec86c4940287b 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -381,8 +381,8 @@ prepareenv() {
        trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGQUIT
 
        # Checking if running as root user
-       if [ $(id -u) -ne 0 ]; then
-                       exiterror "root privileges required for building"
+       if [ "${UID}" -ne 0 ]; then
+               exiterror "root privileges required for building"
        fi
 
        local free_space free_blocks block_size