iscsi: do discovery for every network change

master
Harald Hoyer 2018-07-04 11:28:33 +02:00
parent 6b7ffedf0d
commit 7d0848957c
1 changed files with 2 additions and 6 deletions

View File

@ -218,12 +218,8 @@ handle_netroot()

### ToDo: Upstream calls systemd-run - Shall we, do we have to port this?

if iscsiadm -m node; then
targets=$(iscsiadm -m node | sed 's/^.*iqn/iqn/')
else
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
fi
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