dotfiles/.local/bin/scripts/void

15 lines
456 B
Plaintext
Raw Normal View History

2024-01-12 16:32:16 +00:00
#!/bin/sh
temp=$(mktemp)
target=$(pass app/voidcat)
for arg; do
echo "Uploading $arg"
{ curl --progress-bar -X POST \
-H "V-Content-Type: $(file --mime-type -b $1)" \
-H "V-Full-Digest: $(sha256sum -bz $1 | cut -d' ' -f1)" \
-H "V-Filename: $arg" \
-H "Authorization: Bearer $(echo "$target" | head -1)" \
--data-binary @$arg \
$(echo "$target" | tail -1); echo; } | tee -a $temp
done
test $# -gt 1 && echo && cat $temp | sed 's|http:|https:|'