Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update manual-tracker grep behaviour
According to manual page and StackOverflow, when there is a match grep returns 'SUCCESS', so the logic of the 'if' code must be inverted. In addition, for better output readability, instead of "failure" the output may be "already added" as `transmission-remote` says "Invalid argument" when a torrent has the specific tracker included
  • Loading branch information
Javinator9889 authored May 25, 2020
commit 04d5da1435014a14b95a5b46d7c4c342ec9cc53d
4 changes: 2 additions & 2 deletions manual-tracker-add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ for tracker in $(curl --location -# "${base_url}") ; do
echo -en "\e[0m"
echo -ne "\e[93m*\e[0m ${tracker}..."
if transmission-remote "$host" ${auth:+--auth="$auth"} --torrent "${torrent_hash}" -td "${tracker}" | grep -q 'success'; then
echo -e '\e[91m failed.'
echo -e '\e[92m done.'
echo -en "\e[0m"
else
echo -e '\e[92m done.'
echo -e '\e[93m already added.'
echo -en "\e[0m"
fi
done
Expand Down