Created
November 28, 2018 01:22
-
-
Save neingeist/d27699eeb885fd9725d9622232af1927 to your computer and use it in GitHub Desktop.
upload-oc, a start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
username="neini" | |
password="supersecret" | |
owncloud_url="https://my.domain.de/owncloud" | |
# FIXME parse | |
file="$1" | |
# FIXME urlencode | |
remote_file=`basename "$file"` | |
curl -X PUT -u "$username:$password" \ | |
"$owncloud_url/remote.php/webdav/" \ | |
-T "$file" | |
curl -u "$username:$password" \ | |
"$owncloud_url/ocs/v1.php/apps/files_sharing/api/v1/shares" \ | |
-d "path=/$remote_file&shareType=3&permissions=1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment