Tool to monitor ebook device connection and sync remote (webdav) folder to ebook...
[sync-ebook.git] / mount-watcher
1 #!/bin/bash
2
3 . ~/.config/ebook.conf
4
5 udisksctl monitor | grep --line-buffered MountPoints | while read -r line
6 do
7
8   MOUNTED=`echo $line | awk '{ print $2 }'`
9   if [ "$MOUNTED" == "$EBOOK" ];
10   then
11     sleep 5
12     sync-ebook
13   fi
14
15 done