Running a discovery on a portal that open-iscsi is logged in to may result
in changes to a logged-in node (like changing the node's transport type).
Changing these properties shouldn't be done while logged in.

Signed-off-by: Erez Zilber <[EMAIL PROTECTED]>
---
 utils/iscsi_discovery |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 utils/iscsi_discovery

diff --git a/utils/iscsi_discovery b/utils/iscsi_discovery
old mode 100644
new mode 100755
index 7c7083f..6059efe
--- a/utils/iscsi_discovery
+++ b/utils/iscsi_discovery
@@ -63,6 +63,12 @@ parse_cmdline()
 
 discover()
 {
+       # If open-iscsi is already logged in to the portal, exit
+       if [ $(iscsiadm -m session | grep -c ${ip}:${port}) -ne 0 ]; then
+               echo "Please logout from all targets on ${ip}:${port} before 
trying to run discovery on that portal"
+               exit 2
+       fi
+
        connected=0
        discovered=0
        df=/tmp/discovered.$$
-- 
1.5.3.7



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to