Fix SC2181 ("[ $?") outside tests/

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12042
This commit is contained in:
наб
2021-05-14 11:55:17 +02:00
committed by Brian Behlendorf
parent d53a6969c1
commit 59d91b4d10
11 changed files with 29 additions and 52 deletions
+1 -5
View File
@@ -5,12 +5,8 @@ command -v getargbool >/dev/null || {
# Compatibility with older Dracut versions.
# With apologies to the Dracut developers.
getargbool() {
if ! [ -z "$_b" ]; then
unset _b
fi
_default="$1"; shift
_b=$(getarg "$@")
[ $? -ne 0 ] && [ -z "$_b" ] && _b="$_default"
! _b=$(getarg "$@") && [ -z "$_b" ] && _b="$_default"
if [ -n "$_b" ]; then
[ "$_b" = "0" ] && return 1
[ "$_b" = "no" ] && return 1