summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rwxr-xr-xdrivesync19
2 files changed, 25 insertions, 0 deletions
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