# Parameters
BASENAME="`basename $0`"
PLAYLIST="$1"
+DEST="$2"
MEDIA="/var/cache/media/noise"
PLAYLISTS="$MEDIA/playlists"
if [ -z "$PLAYLIST" ]; then
- echo "Usage: $BASENAME <playlist>"
+ echo "Usage: $BASENAME <playlist> [dest]"
if [ -d "$PLAYLISTS" ]; then
echo ""
if [ "$BASENAME" == "playlist-drop" ]; then
command="drop"
+elif [ "$BASENAME" == "playlist-copy" ]; then
+ if [ -z "$DEST" ]; then
+ echo "No destination specified"
+ exit 1
+ fi
+
+ command="copy"
else
command="get"
fi
dir="$(dirname "$file")"
base="$(basename "$file")"
mkdir -p "$MEDIA/$dir"
- ( cd "$MEDIA/$dir" && git annex $command "$base" )
+ ( cd "$MEDIA/$dir" && git annex $command "$base" $DEST )
done