This commit is contained in:
parent
d4e9905cef
commit
25aff1baab
6
sos/sos
6
sos/sos
@ -68,7 +68,7 @@ function upload() {
|
|||||||
|
|
||||||
# upload the file
|
# upload the file
|
||||||
TARGET_SERVER="https://$server"
|
TARGET_SERVER="https://$server"
|
||||||
echo "Uploading $file to $TARGET_URL"
|
echo "Uploading $file to $TARGET_SERVER"
|
||||||
|
|
||||||
DATETIME=$(datetime)
|
DATETIME=$(datetime)
|
||||||
|
|
||||||
@ -113,14 +113,14 @@ EOF
|
|||||||
-F "metadata=${METADATA_JSON}" \
|
-F "metadata=${METADATA_JSON}" \
|
||||||
-F "hash=${LOCALHASH}" \
|
-F "hash=${LOCALHASH}" \
|
||||||
"$TARGET_SERVER/update" \
|
"$TARGET_SERVER/update" \
|
||||||
|| die "Failed to upload $file to $TARGET_URL"
|
|| die "Failed to upload $file to $TARGET_SERVER/update"
|
||||||
else
|
else
|
||||||
# UPLOAD the file + metadata
|
# UPLOAD the file + metadata
|
||||||
curl -X PUT -H "Authorization: Bearer ${WRITE_TOKEN}" \
|
curl -X PUT -H "Authorization: Bearer ${WRITE_TOKEN}" \
|
||||||
-F "metadata=${METADATA_JSON}" \
|
-F "metadata=${METADATA_JSON}" \
|
||||||
-F "file=@${file}" \
|
-F "file=@${file}" \
|
||||||
"$TARGET_SERVER/upload" \
|
"$TARGET_SERVER/upload" \
|
||||||
|| die "Failed to upload $file to $TARGET_URL"
|
|| die "Failed to upload $file to $TARGET_SERVER/upload"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user