Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 46 lines (44 sloc) 1.426 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/bin/elastichosts-upload b/bin/elastichosts-upload
old mode 100644
new mode 100755
index 158a55e..7297fdc
--- a/bin/elastichosts-upload
+++ b/bin/elastichosts-upload
@@ -16,6 +16,8 @@ Options:
   -d DRIVE-UUID UUID of existing drive to image (default: creates new drive)
   -n NAME name for newly created drive (default: basename of FILENAME)
   -o OFFSET byte offset from which to resume upload (default: 0)
+ -s set drive claim:type parameter as 'shared' - allow multiple
+ simultaneous mounts
   -z input image is gzipped
 EOF
   exit 1
@@ -31,9 +33,10 @@ fi
 CHUNK=4194304
 GUNZIP=0
 OFFSET=0
+CLAIMTYPE=exclusive
 unset DRIVE
 
-while getopts c:d:n:o:z OPTION; do
+while getopts c:d:n:o:sz OPTION; do
   case "$OPTION" in
     c)
       case "$OPTARG" in
@@ -61,6 +64,9 @@ while getopts c:d:n:o:z OPTION; do
           ;;
       esac
       ;;
+ s)
+ CLAIMTYPE=shared
+ ;;
     z)
       GUNZIP=1
       ;;
@@ -86,7 +92,7 @@ EHAUTH="user = \"$EHAUTH\""
 
 if [ -n "$DRIVE" ]; then
   echo "Using existing drive $DRIVE"
-elif POSTDATA=`echo "name $NAME"; echo "size $SIZE"` \
+elif POSTDATA=`echo "name $NAME"; echo "size $SIZE"; echo "claim:type $CLAIMTYPE";` \
   && DRIVE=`curl --data-ascii "$POSTDATA" -K <(echo "$EHAUTH") -f -s \
                  -H 'Content-Type: text/plain' -H 'Expect:' \
                  "${EHURI}drives/create"` \
Something went wrong with that request. Please try again.