Skip to content

Commit 86e3af2

Browse files
add feature host
1 parent d074659 commit 86e3af2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

manual-tracker-add.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
# Get transmission credentials
33
auth=user:password
4+
host=localhost
45

56
add_trackers () {
67
torrent_hash=$1
@@ -13,7 +14,7 @@ add_trackers () {
1314
for tracker in $(curl -# "${base_url}") ; do
1415
echo -en "\e[0m"
1516
echo -ne "\e[93m*\e[0m ${tracker}..."
16-
if transmission-remote --auth="$auth" --torrent "${torrent_hash}" -td "${tracker}" | grep -q 'success'; then
17+
if transmission-remote "$host" --auth="$auth" --torrent "${torrent_hash}" -td "${tracker}" | grep -q 'success'; then
1718
echo -e '\e[91m failed.'
1819
echo -en "\e[0m"
1920
else
@@ -25,10 +26,10 @@ done
2526
}
2627

2728
# Get list of active torrents
28-
ids="$(transmission-remote --auth="$auth" --list | grep -vE 'Seeding|Stopped|Finished' | grep '^ ' | awk '{ print $1 }')"
29+
ids="$(transmission-remote "$host" --auth="$auth" --list | grep -vE 'Seeding|Stopped|Finished' | grep '^ ' | awk '{ print $1 }')"
2930

3031
for id in $ids ; do
31-
hash="$(transmission-remote --auth="$auth" --torrent "$id" --info | grep '^ Hash: ' | awk '{ print $2 }')"
32-
torrent_name="$(transmission-remote --auth="$auth" --torrent "$id" --info | grep '^ Name: ' |cut -c 9-)"
32+
hash="$(transmission-remote "$host" --auth="$auth" --torrent "$id" --info | grep '^ Hash: ' | awk '{ print $2 }')"
33+
torrent_name="$(transmission-remote "$host" --auth="$auth" --torrent "$id" --info | grep '^ Name: ' |cut -c 9-)"
3334
add_trackers "$hash"
3435
done

tracker-add-auto.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Get transmission credentials and ip or dns ardress
33
auth=user:password
44
host=localhost
5+
56
while true ; do
67
sleep 25
78
add_trackers () {

0 commit comments

Comments
 (0)