How to run script before starting vpn connection?

0

I need to run a bash script BEFORE connecting to a vpn (which I do by clicking the network manager applet).

I need this script because when connecting to the vpn the routes are incorrect. The script needs to run before connecting to the vpn because I need to use the command "host" to set new routes and if the vpn has already started I cant access internet.

I would also need to run another script when the vpn disconnect so I can roll everything back to normal.

How can I achieve this?

I am using ubuntu 10.04 lts.

fazpas

Posted 2010-07-04T16:03:09.840

Reputation: 1 353

Answers

0

I use Ubuntu but I guess it is same for all distros. Here is the solution for your problem.

http://www.techytalk.info/2011/03/start-script-on-network-manager-successfull-connection/

Matej

Posted 2010-07-04T16:03:09.840

Reputation: 1

1Please consider adding some excerpt from the linked article. – bytebuster – 2012-11-26T15:03:00.640