From c3dd7c95e17523e77e8558b9cb57176bc8275bea Mon Sep 17 00:00:00 2001 From: "Adam M. Stück" Date: Wed, 23 Nov 2022 11:37:28 +0100 Subject: Improved file structure --- cloud-upload | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 cloud-upload (limited to 'cloud-upload') 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 -- cgit v1.2.3-70-g09d2