Skip to content

Commit d689f31

Browse files
committed
Improve tracker-add-auto.sh output
1 parent 0a33869 commit d689f31

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tracker-add-auto.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ while true; do
1414
trackerslist=/tmp/trackers.txt
1515
for base_url in $trackers; do
1616
if [ ! -f $trackerslist ]; then
17-
curl -o "$trackerslist" "${base_url}"
17+
curl -s --output /dev/null --show-error -o "$trackerslist" "${base_url}"
1818
fi
1919
Local=$(wc -c <$trackerslist)
2020
Remote=$(curl -sI "${base_url}" | awk '/Content-Length/ {sub("\r",""); print $2}')
2121
if [ "$Local" != "$Remote" ]; then
22-
curl -o "$trackerslist" "${base_url}"
22+
curl -s --output /dev/null --show-error -o "$trackerslist" "${base_url}"
2323
fi
2424
echo "URL for ${base_url}"
25-
echo "Adding trackers for $torrent_name..."
25+
echo "Adding trackers for \"$torrent_name\" ($torrent_hash)..."
2626
for tracker in $(cat $trackerslist); do
2727
echo -n "${tracker}..."
2828
if transmission-remote "$host" --auth="$auth" --torrent "${torrent_hash}" -td "${tracker}" | grep -q 'success'; then
@@ -54,7 +54,11 @@ while true; do
5454
torrent_name="$(transmission-remote "$host" --auth="$auth" --torrent "$id" --info | grep '^ Name: ' | cut -c 9-)"
5555
add_trackers "$hash" "$id" &
5656
touch "/tmp/TTAA.$id.lock"
57+
else
58+
echo "Skipping. Torrent #$id ($hash) was just added."
5759
fi
60+
else
61+
echo "Trackers already added for torrent #$id. A file lock was found."
5862
fi
5963
done
6064
done

0 commit comments

Comments
 (0)