From 864f0fd9588ced475e6cc609273e259d9f8d431e Mon Sep 17 00:00:00 2001 From: stkhan Date: Thu, 7 Dec 2023 19:07:44 +0000 Subject: Init commit --- Makefile | 6 ++++++ drivesync | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Makefile create mode 100755 drivesync diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d4598e8 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +all: install + +install: + mkdir -p ~/.local/bin + cp drivesync ~/.local/bin + diff --git a/drivesync b/drivesync new file mode 100755 index 0000000..db3b47d --- /dev/null +++ b/drivesync @@ -0,0 +1,19 @@ +#!/bin/sh +source ~/.config/drivesync.conf +file=$2 +path=$3 + +upload() { + curl -u $username:$password -T $file $server/remote.php/dav/files/$username/$path/ +} + +download() { + curl -u $username:$password -T $file $server/remote.php/dav/files/$username/$path/ + +} + +case $1 in + -u) upload;; + -d) download;; + *) echo -e "drivesync\n -u: Upload file\n -d: Download file";; +esac -- cgit v1.2.3