bash script to automatically control Transmission torrent client upstream bandwidth limit based on current Plex external streams
I built this script for my home server which runs the Transmission torrent client as well as Plex Media Server headless on Debian.
I wanted to make sure my torrent upstream bandwidth took a back seat to any Plex streams that are sent outside of the local network. I'm sure I could have implemented this via some QoS on my router or similar but this worked easily enough for me.
The script parses the XML Session Status returned by PMS, tallies the bitrate of all the "remote" streams and lowers Transmission's max upstream speed by the same amount. It's not a super elegant way to process the XML but it works pretty consistently. A friend suggested I submit it here for anyone interested.
Requires the transmission-cli and curl packages to be installed.
Source: http://pastebin.com/KUUjAGnE
SystemD service unit config: http://pastebin.com/Gq9C1329
PMS version 0.9.16.3
Transmission version 2.84
Posted Mar 31, 2016, 2:39 PM UTC