From: Ben Crocker <[email protected]>

SC2039: bash-isms
SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.

Signed-off-by: Ben Crocker <[email protected]>
---
 redhat/scripts/x86_rngd.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/redhat/scripts/x86_rngd.sh b/redhat/scripts/x86_rngd.sh
index 9781f5765eb1..5cb649d48e22 100755
--- a/redhat/scripts/x86_rngd.sh
+++ b/redhat/scripts/x86_rngd.sh
@@ -1,15 +1,14 @@
-#!/bin/sh
+#!/bin/bash
 #
 # this script is a helper script for i686 and x86_64 builds.  It gets the
 # random number generator running.
 
 echo -n "Trying hardware random number generator ..."
-rngd -r /dev/hwrandom >& /dev/null
-if [ $? -ne 0 ]; then
+if [ "$(rngd -r /dev/hwrandom >& /dev/null)" ]; then
        echo "failed"
        # try the pseudo-random number generator
-       echo "Using psuedo-random number instead"
+       echo "Using pseudo-random number instead"
        rngd -r /dev/urandom >& /dev/null
 else
-       echo "succeded"
+       echo "succeeded"
 fi
-- 
GitLab
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]

Reply via email to