Please refer to my blog for a in-depth explanation on how to use this template.
A small example/template for activating any application upon a connection attempt and deactivate it under certain conditions using systemd.