mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-31 03:04:11 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user