I finally wrote an app called Clutch to add this feature to Transmission! It is a separate app so you don't have to worry about patching, and it will continue to work when new updates to Transmission are released.
How does it work?
Transmission has a hidden option in its preferences file called "BindAddressIPv4" (and IPv6), which allows you to bind Transmission to an IP address. This is a nice feature, but it's a major inconvenience to have to update this address every time you start a new VPN connection. Clutch takes care of this for you!
The app has 2 parts:
- Clutch is the GUI part of the app and allows you to select the interface you want to bind Transmission to.
- Clutch Agent runs in the background (it has an icon in the menu bar) and monitors the IP address of the binding interface. When the IP address changes, it will update the binding IP address in Transmission's preferences and restart Transmission if it was running. There is also an option to start Clutch Agent automatically when you log in.
- This version automatically checks for updates and allows you to update Clutch automatically within the app!
- It also fixes the issue found by @davids: Clutch now restarts Transmission if your binding interface disappears and reappears without changing its IP. This fixes an issue where Transmission would fail to bind to your VPN if it started before the interface was online (this could happen on boot if Transmission opened before your VPN started)
- Support for Dark Mode (colors have been adjusted to work in both Light and Dark Mode)
- You can now resize the window (uses AutoLayout so the UI is perfect)
- Other UI improvements
- Clutch now treats interfaces with the same name but different IPv4/IPv6 statuses as separate interfaces, preventing any traffic from accidentally being sent in the clear if a VPN doesn't support IPv6.
- Initial release
Please note that this is new software and may have bugs!
You can download the app here (move it to your Applications folder):
https://mega.nz/#!2BYHGYJS!TYZUOT01O2uT ... 5V9ZtJ8qW4
https://mega.nz/#!2IAXUYJL!jN7EBqaT9mFQ ... GhfLqjxT9c
https://mega.nz/#!qEh1AQQY!TK2gStUVWhaS ... Jz1pYOyS5I
https://mega.nz/#!PYoQHKpY!ID4wO3XDzjfm ... bn3h7ZQXpc
Clutch is fully open-source, so you can inspect the code yourself. I have licensed it under the BSD license and posted the full source code here:
Like the app?
If you like the Clutch app, post a message here so more people can find it! Thanks!