aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-05-09 22:45:54 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-05-09 22:45:54 -0300
commit25526eae0f7ffebd500e76dc4c8a862a89f47ad8 (patch)
tree26a76c3decf3aadb5526634e814921dcc40d3635
parent2610a49edf075aa1cd2be145ccad6ff61878924a (diff)
downloadscripts-25526eae0f7ffebd500e76dc4c8a862a89f47ad8.tar.gz
scripts-25526eae0f7ffebd500e76dc4c8a862a89f47ad8.tar.bz2
Adds send-to-kobo
-rwxr-xr-xsend-to-kobo27
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"