summaryrefslogtreecommitdiff
path: root/cloud-upload
diff options
context:
space:
mode:
authorAdam M. Stück <adam@adast.xyz>2022-11-23 11:37:28 +0100
committerAdam M. Stück <adam@adast.xyz>2022-12-16 22:17:18 +0100
commitc3dd7c95e17523e77e8558b9cb57176bc8275bea (patch)
tree8e496dc82dbfe2e07c033f6728dad8a4a6d90d6e /cloud-upload
Improved file structure
Diffstat (limited to 'cloud-upload')
-rwxr-xr-xcloud-upload12
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