]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: shellcheck for modules.d/90mdraid/mdraid_start.sh
authorHarald Hoyer <harald@redhat.com>
Fri, 12 Feb 2021 12:26:12 +0000 (13:26 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 15 Feb 2021 10:00:37 +0000 (11:00 +0100)
modules.d/90mdraid/mdraid_start.sh

index ed8d8dfe5773abe7ebb985b6715d564c09401078..71ef8efdb3306010f21f136b1b48d13505ce391b 100755 (executable)
@@ -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