How to make Deluge work only if VPN is active (Torrent KillSwitch)?

I use Deluge on Linux and trying to find out a way to it would only work if VPN is also working. I’ve searched a bit and found a bunch of code, but I kind of suck at coding and didn’t understand a thing.

Is there an easy way to make Deluge only work if VPN is working? I use Surfshark VPN.

Thanks

https://dev.deluge-torrent.org/wiki/UserGuide/VPN

That said, its better to use qBittorrent for this as you can bind both interface and/or IP within qB’s settings regardless of OS used.

Kill switches are reactive so unreliable. Binding is active, so the only thing you should be using.

Read the pinned post

PS. Drop Surfshark, it’s crap