]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
make.sh: Refactor renice and root check
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Nov 2017 12:39:57 +0000 (12:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Nov 2017 12:39:57 +0000 (12:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 65ade72b2403c89031b6b704351b8c5c66f66453..b20e7073d4384b9d0ce5195238fad328e8db7f6f 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -440,18 +440,15 @@ prepareenv() {
        trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
 
        # Resetting our nice level
-       echo -ne "Resetting our nice level to $NICE" | tee -a $LOGFILE
-       renice $NICE $$ > /dev/null
-       if [ `nice` != "$NICE" ]; then
+       if ! renice ${NICE} $$ >/dev/null; then
                        beautify message FAIL
-                       exiterror "Failed to set correct nice level"
+                       exiterror "Failed to set nice level to ${NICE}"
        else
                        beautify message DONE
        fi
 
        # Checking if running as root user
-       echo -ne "Checking if we're running as root user" | tee -a $LOGFILE
-       if [ `id -u` != 0 ]; then
+       if [ $(id -u) -ne 0 ]; then
                        beautify message FAIL
                        exiterror "Not building as root"
        else