Bash script now correctly puts 2 parts.

So what triggered the previous error was an invalid range. What
remains weird is why a failed PUT would still be retrievable
This commit is contained in:
Kevin van Zonneveld 2013-03-20 17:53:45 +01:00
parent d4718fc6f0
commit f67ce78c4d
1 changed files with 2 additions and 5 deletions

View File

@ -23,6 +23,7 @@ ${SERVICE}/files |awk -F': ' '/^Location/ {print $2}' |tr -d '\r')
# `tr -d '\r'` is required or location will have one in it ---^
echo "<-- Location: ${location}"
# PUT some data
echo -ne "PUT '${SERVICE}${location}' \t\t"
status=$(curl -s \
@ -45,17 +46,13 @@ has_content=$(curl -s ${SERVICE}${location})
echo "<-- ${has_content}"
# PUT some data
echo -ne "PUT '${SERVICE}${location}' \t\t"
status=$(curl -s \
--include \
--request PUT \
--header 'Content-Length: 3' \
--header 'Content-Range: bytes 22-25/26' \
--header 'Content-Range: bytes 23-25/26' \
--data 'xyz' \
${SERVICE}${location} |head -1 |tr -d '\r')
echo "<-- ${status}"