diff --git a/ipad.sh b/ipad.sh new file mode 100644 index 0000000..5f839ce --- /dev/null +++ b/ipad.sh @@ -0,0 +1,39 @@ + +ipaddir=/dat/ipad + +rm -rf /dat/ipad/* + +# taz +tazdir=/dat/books/taz +files=$(ls $tazdir/*.epub) +dstdir=$ipaddir/books/taz/ +mkdir -p $dstdir +for f in $files; do + if [ ! -e "$dstdir/$f" ]; then + ln -s "$f" $dstdir + fi +done + +# Bücher dropbox +filedir="/home/marc/Dropbox/Elektronische Bücher (1)" +dstdir=$ipaddir/books +find "$filedir/" -iname "*.epub" -print0 | while read -d $'\0' f +do + if [ ! -e "$dstdir/$f" ]; then + ln -s "$f" $dstdir + fi +done + +# Bücher dropbox +filedir="/home/marc/Dropbox/Elektronische Bücher (1)" +dstdir=$ipaddir/books +find "$filedir/" -iname "*.pdf" -print0 | while read -d $'\0' f +do + b=$filedir/$(basename "$dstdir/$f" .pdf) + #echo $b + if [ ! -e "$b.epub" ]; then + if [ ! -e "$dstdir/$f" ]; then + ln -s "$f" $dstdir + fi + fi +done