base/dracut-lib.sh: relax getargbool value parsing
authorHarald Hoyer <harald@redhat.com>
Tue, 29 Mar 2011 23:45:17 +0000 (01:45 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 29 Mar 2011 23:45:17 +0000 (01:45 +0200)
if a non-boolean value was specified, like "yes" or "no",
getargbool() would error, because we check for "$val -eq 0"

modules.d/99base/dracut-lib.sh

index a5406ab..37b3e76 100755 (executable)
@@ -98,7 +98,7 @@ getargbool() {
     _b=$(getarg "$@")
     [ $? -ne 0 -a -z "$_b" ] && _b=$_default
     if [ -n "$_b" ]; then
-        [ $_b -eq 0 ] && return 1
+        [ $_b = "0" ] && return 1
         [ $_b = "no" ] && return 1
     fi
     return 0