]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: shellcheck for modules.d/90mdraid/module-setup.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/module-setup.sh

index 67acb047c41bec249fc10b678f7fa7938bccbbf8..4f708edffdbd708bc5d76a1dbee38fa22dc56ed7 100755 (executable)
@@ -33,7 +33,7 @@ depends() {
 
 # called by dracut
 installkernel() {
-    instmods =drivers/md
+    instmods '=drivers/md'
 }
 
 # called by dracut
@@ -104,16 +104,16 @@ install() {
     fi
 
     if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
-        if [ -f $dracutsysrootdir/etc/mdadm.conf ]; then
+        if [[ -f $dracutsysrootdir/etc/mdadm.conf ]]; then
             inst -H /etc/mdadm.conf
         else
-            [ -f $dracutsysrootdir/etc/mdadm/mdadm.conf ] && inst -H /etc/mdadm/mdadm.conf /etc/mdadm.conf
+            [[ -f $dracutsysrootdir/etc/mdadm/mdadm.conf ]] && inst -H /etc/mdadm/mdadm.conf /etc/mdadm.conf
         fi
-        if [ -d $dracutsysrootdir/etc/mdadm.conf.d ]; then
+        if [[ -d $dracutsysrootdir/etc/mdadm.conf.d ]]; then
             local f
             inst_dir /etc/mdadm.conf.d
             for f in /etc/mdadm.conf.d/*.conf; do
-                [ -f "$dracutsysrootdir$f" ] || continue
+                [[ -f "$dracutsysrootdir$f" ]] || continue
                 inst -H "$f"
             done
         fi
@@ -127,16 +127,16 @@ install() {
     inst_script "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup
     inst_script "$moddir/mdraid_start.sh" /sbin/mdraid_start
     if dracut_module_included "systemd"; then
-        if [ -e $dracutsysrootdir$systemdsystemunitdir/mdmon@.service ]; then
+        if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdmon@.service ]]; then
             inst_simple $systemdsystemunitdir/mdmon@.service
         fi
-        if [ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.service ]; then
+        if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.service ]]; then
             inst_simple $systemdsystemunitdir/mdadm-last-resort@.service
         fi
-        if [ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.timer ]; then
+        if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.timer ]]; then
             inst_simple $systemdsystemunitdir/mdadm-last-resort@.timer
         fi
-        if [ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-grow-continue@.service ]; then
+        if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-grow-continue@.service ]]; then
             inst_simple $systemdsystemunitdir/mdadm-grow-continue@.service
         fi
     fi