Well, I guess there are no configuration options so I think I will catch dbus notifications that signal the VPN failure and then kill my torrent client so that my traffic doesnt get shaped by my ISP.
Here is a (rudimentary but working) piece of python code that does that:
Code:
#!/usr/bin/env python
#
# licensed under GNU General Public License version 2
#
import sys
import traceback
import gobject
import dbus
import dbus.decorators
import dbus.mainloop.glib
import os
def catchall_signal_handler(*args, **kwargs):
print ("Caught signal (in catchall handler) "
+ kwargs['member'])
if args[0] >= 6: #vpn disconnect (6) or failure (7)
print ("killing bittorrent client")
os.system('killall -9 transmission')
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
#lets make a catchall
bus.add_signal_receiver(catchall_signal_handler, signal_name='VpnStateChanged', interface_keyword='dbus_interface', member_keyword='member')
loop = gobject.MainLoop()
loop.run()
A possible improvement would be to send a dbus signal to close existing internet connections instead of killing only specific apps. I'll do that later when I have some free time