mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +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:
@@ -17,8 +17,7 @@ get_pool_devices() {
|
||||
local prefix
|
||||
local resolved
|
||||
poolconfigtemp=`mktemp`
|
||||
@sbindir@/zpool list -v -H -P "$1" > "$poolconfigtemp" 2>&1
|
||||
if [ "$?" != "0" ] ; then
|
||||
if ! @sbindir@/zpool list -v -H -P "$1" > "$poolconfigtemp" 2>&1 ; then
|
||||
poolconfigoutput=$(cat "$poolconfigtemp")
|
||||
dinfo "zfsexpandknowledge: pool $1 cannot be listed: $poolconfigoutput"
|
||||
else
|
||||
|
||||
@@ -38,11 +38,9 @@ modprobe zfs 2>/dev/null
|
||||
udevadm settle
|
||||
|
||||
if [ "${root}" = "zfs:AUTO" ] ; then
|
||||
ZFS_DATASET="$(find_bootfs)"
|
||||
if [ $? -ne 0 ] ; then
|
||||
if ! ZFS_DATASET="$(find_bootfs)" ; then
|
||||
zpool import -N -a ${ZPOOL_IMPORT_OPTS}
|
||||
ZFS_DATASET="$(find_bootfs)"
|
||||
if [ $? -ne 0 ] ; then
|
||||
if ! ZFS_DATASET="$(find_bootfs)" ; then
|
||||
warn "ZFS: No bootfs attribute found in importable pools."
|
||||
export_all -F
|
||||
|
||||
|
||||
@@ -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