diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2009-08-23 03:08:38 -0500 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2009-08-23 03:08:38 -0500 |
commit | 739e6a44f69ba33d1c627d152894dbeed660ddaf (patch) | |
tree | 4f8a30b9a91b6ec5081a3ea3c1c5d8d884ba65b5 | |
parent | ab95905fab5717d376177035119e81b0ee17e6ff (diff) |
Added some sysfs-based iscsi info grabbing routinesvlowther-merge-gencmdline
These are to be used when generating the iscsi commandline params.
-rwxr-xr-x | modules.d/95iscsi/check | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules.d/95iscsi/check b/modules.d/95iscsi/check index 5a47d97..f475ec5 100755 --- a/modules.d/95iscsi/check +++ b/modules.d/95iscsi/check @@ -20,6 +20,24 @@ is_iscsi() ( done [[ -d iscsi_session ]] ) +emit_iscsi_iqn() ( + is_iscsi $1 || return + cd "$(readlink -f /sys/dev/block/$1)" + until [[ -d iscsi_session ]]; do cd ..; done + cat iscsi_session/${PWD##*/}targetname +) + +emit_iscsi_connections() ( + is_iscsi $1 || return + cd "$(readlink -f /sys/dev/block/$1)" + until [[ -d iscsi_session ]]; do cd ..; done + for conn in connection*; do + [[ -d $conn ]] || continue + addr=$(cat "$conn/iscsi_connection/$conn/persistent_address") + port=$(cat "$conn/iscsi_connection/$conn/persistent_port") + echo "$addr:$port" + done +) case $1 in -h) rootdev=$(find_root_block_device) |