diff options
Diffstat (limited to 'cloud-upload')
-rwxr-xr-x | cloud-upload | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cloud-upload b/cloud-upload new file mode 100755 index 0000000..3f0a454 --- /dev/null +++ b/cloud-upload @@ -0,0 +1,12 @@ +#!/bin/bash + +PREFIX=$(dirname "$0") +CLOUD_AUTH=$(<"$PREFIX/cloud-auth") +UPLOAD_PATH="https://cloud.adast.xyz/public.php/webdav/uploads" + +if [ -f "$1" ]; then + FILE=$(basename "$1") + curl -T "$1" -u "$CLOUD_AUTH" "$UPLOAD_PATH/$FILE" +else + echo "error: invalid file $1" +fi |