2

Openvpn can execute a script upon connection using the --up parameter. However this does not seem to work at reconnecting, i.e. when a connection is lost and openvpn automatically reconnects. Is this normal behaviour and is there a way to execute scripts on reconnect too?

Background is that there is a service that supposed to communicate over a VPN. If the connection gets lost, the service might timeout and quit. Therefore I want to have a script running on VPN-connection, that checks if the service is running and if not, starting it.

1 Answer 1

2

This is normal behavior. By default, OpenVPN does not run the --up script for partial restarts (In your case: reconnects) . You can change this behavior by using the --up-restart option in your client config. This is clearly documented in the OpenVPN Manual

2
  • @Jherek did you try this ?
    – dotvotdot
    Nov 18, 2015 at 16:13
  • I did something with a cron job as a workaround. But thanks for your answer anyhow. When I have time I will look into it again. Dec 3, 2015 at 10:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .