#!/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 -X GET -u $username:$password $server/remote.php/dav/files/$username/$file --output $path } case $1 in -u) upload;; -d) download;; *) echo -e "drivesync\n -u: Upload file\n -d: Download file";; esac