From: Ben Crocker <bcrocker(a)redhat.com>
SC2039: bash-isms
SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Signed-off-by: Ben Crocker <bcrocker(a)redhat.com>
---
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..b67f11385553 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