Run python script on openvpn up and down

Hi

How do I on my client run a script when i connect to the vpn?

i want to do something like this, but i can not get it to work, and also think that pritunl sync just removes the up/down i add?

script-security 2
up "python up.py"
down "python down.py"

So in other words can i add custom things to the openvpn conf the client get from the server

(I have the enterprise version)

The plugin system can be used for this.

Hi

So i can make a plugin that run a python script on the clients pc when they connect?
I thought the plugin part only run on the server?

So i can add a plugin that will execute my python script on the client device on login, and again when they disconnect, will the server then “push” my python script to the client so it can also run when disconnected eg if the user lost there internet and the vpn fails/disconnects?

The plugin code won’t run on the clients device. There’s handles for several different events including clients connecting.

Okay thanks, then it will not work for the use case im trying to solve as im looking for a replacement for the up/down part of openvpn

We will try and go another way then.