Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit 5aea0b7

Browse files
committed
Exit if no more trackers found
1 parent edacade commit 5aea0b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tracker-add.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ base_url='http://torrentz.eu'
55
pattern='announcelist_[0-9]+'
66

77
if [ -z "$1" ] ; then
8-
echo "usage: ./tracker-add sh <hash>"
8+
echo 'Usage: ./tracker-add sh <hash>'
99
exit 1
1010
fi
1111

1212
announce_list=`curl -s ${base_url}/${torrent_hash} | grep -Eo "${pattern}"`
1313

14+
if [ -z "$announce_list" ] ; then
15+
echo 'No additional trackers found, sorry.'
16+
exit 1
17+
fi
18+
1419
for tracker in $(curl -s ${base_url}/${announce_list})
1520
do
1621
echo "Adding ${tracker} to torrent ${torrent_hash}"

0 commit comments

Comments
 (0)