diff --git a/sos/sos b/sos/sos index 3ae35aa..6e835df 100755 --- a/sos/sos +++ b/sos/sos @@ -1,13 +1,6 @@ #!/bin/bash set -euo pipefail -# sos upload - -# example: -# sos upload tools.dropshell.app file:latest ./file.txt - -# this will upload the file to the server, and return the download URL - # get dropshell TEMP_DIR=$(mktemp -d) @@ -74,7 +67,7 @@ function upload() { # upload the file - TARGET_URL="https://$server/upload" + TARGET_SERVER="https://$server" echo "Uploading $file to $TARGET_URL" DATETIME=$(datetime) @@ -84,6 +77,11 @@ function upload() { LABELTAGS_JSON=$(printf '"%s",' "${LABELTAGS[@]}") LABELTAGS_JSON="[${LABELTAGS_JSON%,}]" + # trip whitespace from the file path + LOCALHASH=$("${DROPSHELL}" hash "${file}" | tr -d '[:space:]') + echo "Local hash: $LOCALHASH" + + METADATA_JSON=$(cat <