From: Harald Hoyer Date: Fri, 12 Feb 2021 12:26:12 +0000 (+0100) Subject: fix: shellcheck for modules.d/90mdraid/module-setup.sh X-Git-Tag: 052~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87ea36797f53084d68abed562598ad4d575fd741;p=thirdparty%2Fdracut.git fix: shellcheck for modules.d/90mdraid/module-setup.sh --- diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh index 67acb047c..4f708edff 100755 --- a/modules.d/90mdraid/module-setup.sh +++ b/modules.d/90mdraid/module-setup.sh @@ -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