Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using ubuntu 12.04 to connect an openvpn server.

Two scripts update-resolv-conf and in /etc/openvpn should be executed then the connection established.

The commands following added to the configure file client.ovpn to make the two scripts run when openvpn connects and stop when openvpn disconnects:

script-security 2
up /etc/openvpn/update-resolv-conf
up /etc/openvpn/
down /etc/openvpn/
down /etc/openvpn/update-resolv-conf

However, during connection only the first script is executed. And every time I have to run the script individually by hand. So I want to know how to get them both work when openvpn tunnel is established?


share|improve this question

1 Answer 1

up vote 2 down vote accepted

A quick hack would be to call the 2nd script from the end of the last one:

Just add the following to the end of the '/etc/openvpn/update-resolv-conf' script:


I'm sure people here will provide a more elegant way to do this.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.