Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # this Script will change the torrent tracker to the new karagarga url
- # you may need to change in order to inform if your server is in another host
- TORRENTLIST=`transmission-remote --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=" " --fields=1`
- NEW_URL="http://karagarga.in:80"
- # for each torrent in the list
- for TORRENTID in $TORRENTLIST
- do
- # check if torrent tracker is karagara.net
- TRACKER_KARAGARGA=`transmission-remote --torrent $TORRENTID --info-trackers | grep -i "karagarga.net"`
- # if the torrent is "Stopped", "Finished", or "Idle after downloading 100%"
- if [ "$TRACKER_KARAGARGA" ]; then
- #First remove the old tracker
- # it may be as tracker 0
- transmission-remote --torrent $TORRENTID --tracker-remove 0
- # add new kagagarga url as tracker
- echo "Torrent #$TORRENTID have karagarga.net as tracker"
- echo "Changing tracker to $NEW_URL"
- transmission-remote --torrent $TORRENTID -td $NEW_URL
- else
- echo "Torrent #$TORRENTID does not have karagarga as tracker, nothing to do."
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment