File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# Get transmission credentials
3
3
auth=user:password
4
- while true
5
- do
4
+ while true ; do
6
5
sleep 5
7
6
add_trackers () {
8
7
torrent_hash=$1
19
18
fi
20
19
done
21
20
done
22
- sleep 3m
23
- rm -f /tmp/TTAA.$id .lock
21
+ sleep 3m
22
+ rm -f /tmp/TTAA.$id .lock
24
23
}
25
24
# Get list of active torrents
26
25
ids=" $( transmission-remote --auth=" $auth " --list | grep -vE ' Seeding|Stopped|Finished' | grep ' ^ ' | awk ' { print $1 }' ) "
27
- for id in $ids ; do
28
- add_date=" $( transmission-remote --auth=" $auth " --torrent " $id " --info| grep ' ^ Date added: ' | cut -c 21-) "
29
- add_date_t=" $( date -d " $add_date " " +%Y-%m-%d %H:%M" ) "
30
- dater=" $( date " +%Y-%m-%d %H:%M" ) "
31
- dateo=" $( date -d " 1 minutes ago" " +%Y-%m-%d %H:%M" ) "
26
+ for id in $ids ; do
27
+ add_date=" $( transmission-remote --auth=" $auth " --torrent " $id " --info| grep ' ^ Date added: ' | cut -c 21-) "
28
+ add_date_t=" $( date -d " $add_date " " +%Y-%m-%d %H:%M" ) "
29
+ dater=" $( date " +%Y-%m-%d %H:%M" ) "
30
+ dateo=" $( date -d " 1 minutes ago" " +%Y-%m-%d %H:%M" ) "
32
31
33
32
if [ ! -f /tmp/TTAA.$id .lock ]; then
34
33
if [[ ( " $add_date_t " == " $dater " || " $add_date_t " == " $dateo " ) ]]; then
35
- hash=" $( transmission-remote --auth=" $auth " --torrent " $id " --info | grep ' ^ Hash: ' | awk ' { print $2 }' ) "
36
- torrent_name=" $( transmission-remote --auth=" $auth " --torrent " $id " --info | grep ' ^ Name: ' | cut -c 9-) "
34
+ hash=" $( transmission-remote --auth=" $auth " --torrent " $id " --info | grep ' ^ Hash: ' | awk ' { print $2 }' ) "
35
+ torrent_name=" $( transmission-remote --auth=" $auth " --torrent " $id " --info | grep ' ^ Name: ' | cut -c 9-) "
37
36
add_trackers " $hash " " $id " &
38
37
touch /tmp/TTAA.$id .lock
39
38
fi
You can’t perform that action at this time.
0 commit comments