From: Harald Hoyer Date: Fri, 12 Feb 2021 12:26:12 +0000 (+0100) Subject: fix: shellcheck for modules.d/95dcssblk/module-setup.sh X-Git-Tag: 052~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfac3a5675e633339da069387602c6d883666548;p=thirdparty%2Fdracut.git fix: shellcheck for modules.d/95dcssblk/module-setup.sh --- diff --git a/modules.d/95dcssblk/module-setup.sh b/modules.d/95dcssblk/module-setup.sh index 05c7f5c73..bbd045021 100755 --- a/modules.d/95dcssblk/module-setup.sh +++ b/modules.d/95dcssblk/module-setup.sh @@ -5,14 +5,20 @@ # called by dracut check() { local _arch=${DRACUT_ARCH:-$(uname -m)} - [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 + [[ "$_arch" = "s390" ]] || [[ "$_arch" = "s390x" ]] || return 1 return 0 } # called by dracut installkernel() { - if [ -e /sys/devices/dcssblk/*/block/dcssblk* ];then - hostonly='' instmods dcssblk + if [[ $hostonly ]]; then + for dev in /sys/devices/dcssblk/*/block/dcssblk* ; do + [[ -e $dev ]] || continue + hostonly='' instmods dcssblk + return $? + done + else + hostonly='' instmods dcssblk fi }