--- /dev/null
+USER=user
+PASSWD=mystrongpasswd
+DAVFS=davs://server/path
+EBOOK=/media/rvb/EbookLabel
+SRCDIR="Books"
+DSTDIR="My Books"
+TEMPLATE="*.fb2,*.fb2.zip"
--- /dev/null
+#!/usr/bin/expect
+
+set timeout 10
+spawn gvfs-mount [lindex $argv 0]
+expect "User:"
+send "[lindex $argv 1]\r"
+expect "Password:"
+send "[lindex $argv 2]\r"
+expect eof
+
--- /dev/null
+#!/bin/bash
+
+. ~/.config/ebook.conf
+
+udisksctl monitor | grep --line-buffered MountPoints | while read -r line
+do
+
+ MOUNTED=`echo $line | awk '{ print $2 }'`
+ if [ "$MOUNTED" == "$EBOOK" ];
+ then
+ sleep 5
+ sync-ebook
+ fi
+
+done
--- /dev/null
+#!/bin/sh
+
+. ~/.config/ebook.conf
+
+mount-gvfs $DAVFS $USER $PASSWD
+
+MOUNT=$XDG_RUNTIME_DIR/gvfs/
+DIR=`gvfs-info $DAVFS | grep "id::filesystem" | awk '{ print $2; }'`
+
+if [ "$DIR" != "" ]
+then
+
+MOUNT=$XDG_RUNTIME_DIR/gvfs/$DIR
+
+if [ -d $EBOOK ]
+then
+
+rsync -ru --include=$TEMPLATE --exclude=.* "$MOUNT/$SRCDIR/" "$EBOOK/$DSTDIR/"
+
+fi
+
+fi
\ No newline at end of file