What's new

script VPN Client goes down

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

schranzc

Occasional Visitor
Hello,

I know the script "openvpn-event" which is called whenever the OpenVPN-Client connects (or VPN-Server connects or go down) - but is there a way to run a script if OpenVPN-Client goes down?

Thank you so much!
 
updown.sh is called on --up and --down, and in turns it also calls openvpn-event.

There are other script hooks in OpenVPN, check the man page in case --down doesn't get called on a pure disconnect (rather than the client being manually stopped).
 
I don't know what I should do :) Where should I add the file "updown.sh"? In "/jffs/scripts/"? - doesn't work :(
 
I don't know what I should do :) Where should I add the file "updown.sh"? In "/jffs/scripts/"? - doesn't work :(

updown.sh is what the firmware uses internally, you cannot replace it. That script will call openvpn-event, which is the one you can create to put your own code in it.
 
Hello,

I know the script "openvpn-event" which is called whenever the OpenVPN-Client connects (or VPN-Server connects or go down) - but is there a way to run a script if OpenVPN-Client goes down?

Thank you so much!

https://tunnelblick.net/cUsingScripts.html
route-up is executed after connection authentication, either immediately after, or some number of seconds after as defined by the --route-delay option.
route-pre-down is executed right before the routes are removed.
down is executed after TCP/UDP and TUN/TAP close.

you have sample script /jffs/scripts/vpn-route-1.sh check link below, adjust it to your need
http://www.snbforums.com/threads/de...-usual-with-asuswrt-merlin.31415/#post-253228
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top