-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtorrent.spell
More file actions
executable file
·39 lines (37 loc) · 829 Bytes
/
Copy pathtorrent.spell
File metadata and controls
executable file
·39 lines (37 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
pgrep -f transmission-daemon >/dev/null || {
transmission-daemon --download-dir ~/dl/
echo -n "waiting for deamon to start"
sleep 5
echo -en "\r\e[K"
}
case "$1" in
a | add)
transmission-remote -a "${@:2}"
;;
d | del)
t="$(transmission-remote -l |
grep -vP '^(\s+ID)|Sum:' |
fzf --height="$(transmission-remote -l | wc -l)" \
--layout=reverse |
awk '{print $1}' |
sed 's/\*//g')"
[[ "$t" ]] || return 0
transmission-remote -t "$t" --remove
;;
'' | l | list)
transmission-remote -l
;;
*)
cat <<EOF
Usage: $0 COMMAND
Commands:
l | list
List running torrents
a | add
Add a torrent to the list
d | del
Remove a torrent
EOF
;;
esac