#!/usr/bin/env sh # # usage: cptorrents [dir] dir=${1:-~/Downloads} files=$(find $dir -name "*.torrent") if [ -n "$files" ]; then printf "selected torrents from $dir:\n$files\n\n" read -p "ok? [Y/n] " reply case $reply in n | N | no | NO ) exit 1;; *) printf "syncing\n"; rsync -av "${files[@]}" ben@dev.simatime.com:/mnt/campbell/ben/torrents/in; rm $dir/*.torrent; exit 0; esac else echo "No torrents found." exit 1 fi