File: dropbox.sh

package info (click to toggle)
sambamba 1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,528 kB
  • sloc: sh: 220; python: 166; ruby: 147; makefile: 103
file content (6 lines) | stat: -rwxr-xr-x 319 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
#!/bin/bash
for i in "$@"; do
  CONTENT_LENGTH=`ls -la "$i" | awk '{ print $5}'`
  curl --request PUT --header "Content-Length: "${CONTENT_LENGTH}"" --header "Content-Type: multipart/mixed" --data-binary "@"$i"" "https://api-content.dropbox.com/1/files_put/sandbox/$i?access_token="${ACCESS_TOKEN}""
  printf "\n"
done