[PATCH] dracut: minor shell cleanup

Will Woods wwoods at redhat.com
Fri Jan 10 16:41:18 UTC 2014


getargbool doesn't echo any result, so $(getargbool ...) will always
evaluate to the empty string (""). This works fine in this case:

    if $(getargbool ...); then ...

because the 'if' statement uses the *return* value of the command, not its
output. But if getargbool echoed a result (like getarg), this would
break. So remove the subshell escape.
---
 dracut/parse-anaconda-options.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dracut/parse-anaconda-options.sh b/dracut/parse-anaconda-options.sh
index 4ed6650..a508938 100755
--- a/dracut/parse-anaconda-options.sh
+++ b/dracut/parse-anaconda-options.sh
@@ -104,7 +104,7 @@ warn_renamed_arg "kssendsn" "inst.ks.sendsn"
 
 # Ignore self-signed SSL certs
 warn_renamed_arg "noverifyssl" "inst.noverifyssl"
-if $(getargbool 0 noverifyssl inst.noverifyssl); then
+if getargbool 0 noverifyssl inst.noverifyssl; then
     # Tell dracut to use curl --insecure
     echo "rd.noverifyssl" >> /etc/cmdline.d/75-anaconda-options.conf
 fi
-- 
1.8.4.2



More information about the anaconda-patches mailing list