#!/bin/sh
# Copy directories of documents to Kindle and make them into collections
# (c) Reuben Thomas   26th December 2010
# This program is in the public domain

if [ $# -lt 2 ]; then
    echo "Usage: copy-collection-to-kindle MOUNT-POINT DIRECTORY..."
    exit 1
fi

mountpoint=$1
shift

for i; do
    cd "$i"
    cp * $mountpoint/documents/
    kcollect -r $mountpoint add "$i" *
    cd ..
done
