diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2020-05-09 22:45:54 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2020-05-09 22:45:54 -0300 |
commit | 25526eae0f7ffebd500e76dc4c8a862a89f47ad8 (patch) | |
tree | 26a76c3decf3aadb5526634e814921dcc40d3635 | |
parent | 2610a49edf075aa1cd2be145ccad6ff61878924a (diff) | |
download | scripts-25526eae0f7ffebd500e76dc4c8a862a89f47ad8.tar.gz scripts-25526eae0f7ffebd500e76dc4c8a862a89f47ad8.tar.bz2 |
Adds send-to-kobo
-rwxr-xr-x | send-to-kobo | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/send-to-kobo b/send-to-kobo new file mode 100755 index 0000000..9384f3a --- /dev/null +++ b/send-to-kobo @@ -0,0 +1,27 @@ +#!/bin/bash +# +# A mini-wrapper to sync a local folder into kobo. +# + +# Parameters +BASENAME="`basename $0`" +BASEFOLDER="$HOME/data/doc" +COLLECTION="$1" + +# Check +if [ -z "$COLLECTION" ]; then + echo "usage: $BASENAME <colletion>" + echo "available collections:" + echo "" + ls $BASEFOLDER + exit 1 +fi + +# Ensure collection exists +if [ ! -d "$BASEFOLDER/$COLLECTION" ]; then + echo "error: no such collection $COLLECTION at $BASEFOLDER" + exit 1 +fi + +# Dispatch +lftp -c "open sftp://kobo && mirror -L -R $BASEFOLDER/$COLLECTION /mnt/sd/$COLLECTION" |