24 lines
408 B
Bash
Executable File
24 lines
408 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# SPDX-FileCopyrightText: 2020-2021 Simon Bruder <simon@sbruder.de>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -e
|
|
|
|
function cleanup {
|
|
fusermount -u "$library"
|
|
rm -rf "$library"
|
|
}
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "USAGE: $0 host:path"
|
|
exit 1
|
|
fi
|
|
|
|
library=$(mktemp -p /tmp -d calibre-remote.XXXXXXXXXX)
|
|
sshfs "$1" "$library"
|
|
trap cleanup EXIT INT TERM
|
|
|
|
calibre --with-library="$library"
|