Skip to content

Commit d98ad2c

Browse files
Merge pull request #11 from pataquets/master
Allow specifying host, user, pass and tracker URL via environment vars
2 parents 6153196 + 6fca26f commit d98ad2c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

manual-tracker-add.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#!/bin/bash
22
# Get transmission credentials
3-
auth=user:password
4-
host=localhost
3+
auth=${TRANSMISSION_USER:-user}:${TRANSMISSION_PASS:-password}
4+
host=${TRANSMISSION_HOST:-localhost}
5+
list_url=${TRACKER_URL:-https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt}
56

67
add_trackers () {
78
torrent_hash=$1
8-
for base_url in https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt ; do
9+
for base_url in "${list_url}" ; do
910
echo -e "\e[1m\e[5m"
1011
echo "URL for ${base_url}"
1112
echo -e "Adding trackers for \e[91m$torrent_name..."
1213
echo -en "\e[0m"
1314
echo -e "\e[2m\e[92m"
14-
for tracker in $(curl -# "${base_url}") ; do
15+
for tracker in $(curl --location -# "${base_url}") ; do
1516
echo -en "\e[0m"
1617
echo -ne "\e[93m*\e[0m ${tracker}..."
1718
if transmission-remote "$host" --auth="$auth" --torrent "${torrent_hash}" -td "${tracker}" | grep -q 'success'; then

0 commit comments

Comments
 (0)