New open-iscsi ebuild

git-svn-id: svn+ssh://svnintern.kmrc.de/projects/gentoo/iwm-overlay@11449 cbe59ace-07ea-0310-918e-868702b5370d
This commit is contained in:
2009-11-05 16:04:41 +00:00
parent 69bc427bd6
commit cb1a889ef3
3 changed files with 56 additions and 19 deletions
@@ -0,0 +1,31 @@
--- utils.orig/iscsi_discovery 2009-10-26 23:09:08.000000000 +0100
+++ utils/iscsi_discovery 2009-10-26 23:11:56.000000000 +0100
@@ -104,24 +104,22 @@
connected=0
discovered=0
- df=/tmp/discovered.$$
dbg "starting discovery to $ip"
- iscsiadm -m discovery --type sendtargets --portal ${ip}:${port} > ${df}
- while read portal target
+ disc="$(iscsiadm -m discovery --type sendtargets --portal ${ip}:${port})"
+ echo "${disc}" | while read portal target
do
portal=${portal%,*}
select_transport
- done < ${df}
+ done
- discovered=$(cat ${df} | wc -l)
+ discovered=$(echo "${disc}" | wc -l)
if [ ${discovered} = 0 ]; then
echo "failed to discover targets at ${ip}"
exit 2
else
echo "discovered ${discovered} targets at ${ip}"
fi
- /bin/rm -f ${df}
}
try_login()