diff options
-rwxr-xr-x | addIscsiDisk | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/addIscsiDisk b/addIscsiDisk index a0143de..1aee906 100755 --- a/addIscsiDisk +++ b/addIscsiDisk @@ -29,13 +29,13 @@ if [ -r /proc/net/iet/volume ]; then echo "Disk is already configured in ietd. Skipping live update." >&2 else # get the next avilable tid - tid=$(awk '$1 ~ /tid:/ { \ - gsub(/tid:/,"",$1); \ - if ( max < $1 ) { \ - max=$1 \ - } \ - } \ - \ + tid=$(awk '$1 ~ /tid:/ { \ + gsub(/tid:/,"",$1); \ + if ( max < int($1) ) { \ + max=int($1) \ + } \ + } \ + \ END { print max+1 }' /proc/net/iet/volume) echo -n "Adding disk to running ietd... " >&2 |