From 25526eae0f7ffebd500e76dc4c8a862a89f47ad8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 9 May 2020 22:45:54 -0300 Subject: Adds send-to-kobo --- send-to-kobo | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 send-to-kobo 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 " + 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" -- cgit v1.2.3