From: Harald Hoyer Date: Fri, 12 Feb 2021 12:26:12 +0000 (+0100) Subject: fix: shellcheck for modules.d/90mdraid/mdraid_start.sh X-Git-Tag: 052~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b29b9e9627e13e7f1606f054099b1ee1c5ee9284;p=thirdparty%2Fdracut.git fix: shellcheck for modules.d/90mdraid/mdraid_start.sh --- diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh index ed8d8dfe5..71ef8efdb 100755 --- a/modules.d/90mdraid/mdraid_start.sh +++ b/modules.d/90mdraid/mdraid_start.sh @@ -9,23 +9,23 @@ _md_start() { local _md="$1" _udevinfo="$(udevadm info --query=env --name="${_md}")" - strstr "$_udevinfo" "MD_LEVEL=container" && continue - strstr "$_udevinfo" "DEVTYPE=partition" && continue + strstr "$_udevinfo" "MD_LEVEL=container" && return 0 + strstr "$_udevinfo" "DEVTYPE=partition" && return 0 _path_s="/sys/$(udevadm info -q path -n "${_md}")/md/array_state" - [ ! -r "$_path_s" ] && continue + [ ! -r "$_path_s" ] && return 0 # inactive ? - [ "$(cat "$_path_s")" != "inactive" ] && continue + [ "$(cat "$_path_s")" != "inactive" ] && return 0 mdadm -R "${_md}" 2>&1 | vinfo # still inactive ? - [ "$(cat "$_path_s")" = "inactive" ] && continue + [ "$(cat "$_path_s")" = "inactive" ] && return 0 _path_d="${_path_s%/*}/degraded" - [ ! -r "$_path_d" ] && continue - > $hookdir/initqueue/work + [ ! -r "$_path_d" ] && return 0 + : > "$hookdir"/initqueue/work } _md_force_run() { @@ -42,7 +42,7 @@ _md_force_run() { [ -b "$_md" ] || continue _UUID=$( /sbin/mdadm -D --export "$_md" \ - | while read line || [ -n "$line" ]; do + | while read -r line || [ -n "$line" ]; do str_starts "$line" "MD_UUID=" || continue printf "%s" "${line#MD_UUID=}" done