From: Martin Wilck Date: Thu, 4 Apr 2019 13:40:14 +0000 (+0200) Subject: iscsiroot: there's never more than one target per call X-Git-Tag: 050~132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d5597044fb8690997d50b431aca00efb5719954;p=thirdparty%2Fdracut.git iscsiroot: there's never more than one target per call iscsi_target_name is set by iscsi_root, and thus can't have more than one member. This allows us to get rid of one bashism in iscsiroot.sh. --- diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh index 45db89c1d..a334b76ea 100755 --- a/modules.d/95iscsi/iscsiroot.sh +++ b/modules.d/95iscsi/iscsiroot.sh @@ -213,10 +213,8 @@ handle_netroot() targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/') [ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1 - for target in $iscsi_target_name; do - case "$targets" in - *$target*) - EXTRA="" + for target in $targets; do + if [ "$target" = "$iscsi_target_name" ]; then if [ -n "$iscsi_iface_name" ]; then iscsiadm -m iface -I $iscsi_iface_name --op=new EXTRA=" ${iscsi_netdev_name:+--name=iface.net_ifacename --value=$iscsi_netdev_name} " @@ -239,10 +237,7 @@ handle_netroot() if [ "$netif" != "timeout" ]; then $CMD --login fi - ;; - *) - ;; - esac + fi done if [ "$netif" = "timeout" ]; then