From e851401694daacaf1aba2c87ed557e5dbf00af02 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 20 Aug 2024 20:44:34 -0300 Subject: Move scripts to other repositories --- copy-annotations-from-kobo | 67 ---------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100755 copy-annotations-from-kobo (limited to 'copy-annotations-from-kobo') diff --git a/copy-annotations-from-kobo b/copy-annotations-from-kobo deleted file mode 100755 index f86d1fe..0000000 --- a/copy-annotations-from-kobo +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# A mini-wrapper to copy a remote kobo annotation into a local one. -# - -# Parameters -BASENAME="`basename $0`" -BASEFOLDER="$HOME/data/doc" -REMOTE_BASE="/mnt/sd" -REMOTE="kobo" -PATTERN="$1" - -# Thanks https://serverfault.com/a/764403 -# https://serverfault.com/questions/36421/stop-ssh-login-from-printing-motd-from-the-client#38160 -function silentSsh { - local connectionString="$1" - shift - local commands="$*" - if [ -z "$commands" ]; then - commands=`cat` - fi - ssh -T $connectionString "$commands" -} - -# Check -if [ -z "$PATTERN" ]; then - echo "usage: $BASENAME " - exit 1 -fi - -# Dispatch -show --search "$PATTERN" | while read item; do - #sdr="`echo $item | sed -e 's/\.pdf$//' -e 's/\.epub$//' -e 's/\.djvuf$//'`.sdr" - basename="`echo $item | sed -e 's/\.[^.]*$//'`" - extension="$(echo $item | sed -e "s|$basename.||")" - sdr="$basename.sdr" - - # Check if remote file exists - silentSsh $REMOTE <"$BASEFOLDER/$sdr/metadata.$extension.lua" <