[OS-BUILD PATCHv2 13/20] [redhat] x86_rngd.sh: Fix syntax flagged by shellcheck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Crocker <bcrocker@xxxxxxxxxx>

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

Signed-off-by: Ben Crocker <bcrocker@xxxxxxxxxx>
---
 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
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux