diff options
author | Ben Sima <ben@bsima.me> | 2018-06-13 21:36:56 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-06-13 21:36:56 -0700 |
commit | 77c9a177b2b595d4ce25095b58e2388fe33cc97a (patch) | |
tree | 0853d5c92d67538760005b9c4635a90115bd7ba4 /cptorrents |
init
Diffstat (limited to 'cptorrents')
-rwxr-xr-x | cptorrents | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cptorrents b/cptorrents new file mode 100755 index 0000000..a1f9415 --- /dev/null +++ b/cptorrents @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +files=$(ls ~/Downloads/*.torrent) + +if [ -n "$files" ]; then + printf "selected torrents:\n$files\n\n" + read -p "ok? [Y/n] " reply + case $reply in + n | N | no | NO ) exit 1;; + *) printf "syncing\n"; + rsync -av ~/Downloads/*.torrent ben@$(cat ~/me/data/home-ip):/mnt/lake/ben/torrents/in; + rm ~/Downloads/*.torrent; + exit 0; + esac +else + echo "No torrents found." + exit 1; +fi |