Skip to content

Commit c58e87d

Browse files
Cosmetic fixes
1 parent c55c70b commit c58e87d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tracker-add-auto.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/bash
22
# Get transmission credentials
33
auth=user:password
4-
while true
5-
do
4+
while true ; do
65
sleep 5
76
add_trackers () {
87
torrent_hash=$1
@@ -19,21 +18,21 @@ else
1918
fi
2019
done
2120
done
22-
sleep 3m
23-
rm -f /tmp/TTAA.$id.lock
21+
sleep 3m
22+
rm -f /tmp/TTAA.$id.lock
2423
}
2524
# Get list of active torrents
2625
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")"
3231

3332
if [ ! -f /tmp/TTAA.$id.lock ]; then
3433
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-)"
3736
add_trackers "$hash" "$id" &
3837
touch /tmp/TTAA.$id.lock
3938
fi

0 commit comments

Comments
 (0)