- Bash curl script to send files & folders to shared public link in Nextcloud / Owncloud

Continuing the discussion from Activity on Folders: is one handy script! Want to make sure it gets visibility and a dedicated topic here on the forum. :heart:

How do you use it?

Project github page with script, examples, details

Help file:

$ ./ --help
Tavinus Cloud Sender v2.2.0

  -h | --help              Print this help and exits
  -q | --quiet             Disables verbose messages
  -V | --version           Prints version and exits
  -r | --rename <> Change the destination file name
  -g | --glob              Disable input file checking to use curl globs
  -k | --insecure          Uses curl with -k option (https insecure)
  -p | --password <pass>   Uses <pass> as shared folder password
  -e | --envpass           Uses env var $CLOUDSEND_PASSWORD as share password
                           You can 'export CLOUDSEND_PASSWORD' at your system, or set it at the call
                           Please remeber to also call -e to use the password set

  ./ [options] <inputPath> <folderLink>
  CLOUDSEND_PASSWORD='MySecretPass' ./ -e [options] <inputPath> <folderLink>

  Cloudsend 2 changed the way password works
  Cloudsend 0.x.x used the '-p' parameter for the Environment password (changed to -e in v2+)
  Please use EITHER -e OR -p, but not both. The last to be called will be used

    Env Pass > Set the variable CLOUDSEND_PASSWORD='MySecretPass' and use the option '-e'
  Param Pass > Send the password as a parameter with '-p <password>'

  Cloudsend 2.2.0 introduces folder tree sending. Just use a directory as <inputPath>.
  It will traverse all files and folders, create the needed folders and send all files.
  Each folder creation and file sending will require a curl call.

Input Globbing:
  You can use input globbing (wildcards) by setting the -g option
  This will ignore input file checking and pass the glob to curl to be used
  You MUST NOT rename files when globbing, input file names will be used
  You MUST NOT send folders when globbing, only files are allowed
  Glob examples: '{file1.txt,file2.txt,file3.txt}'

Send from stdin (pipe):
  You can send piped content by using - or . as the input file name (curl specs)
  You MUST set a destination file name to use stdin as input (-r <name>)

  Use the file name '-' (a single dash) to use stdin instead of a given file
  Alternately, the file name '.' (a single period) may be specified instead of '-' to use
  stdin in non-blocking mode to allow reading server output while stdin is being uploaded

  CLOUDSEND_PASSWORD='MySecretPass' ./ -e './myfile.txt' ''
  ./ './myfile.txt' ''
  ./ 'my Folder' ''
  ./ -r 'RenamedFile.txt' './myfile.txt' ''
  ./ -p 'MySecretPass' './myfile.txt' ''
  ./ -p 'MySecretPass' -r 'RenamedFile.txt' './myfile.txt' ''
  ./ -g -p 'MySecretPass' '{file1,file2,file3}' ''
  cat file | ./ - '' -r destFileName